This is my data using which I want to achieve YTD sum by selecting single date in the filter.
e.g. Add date parameter on Month1 when I choose 1-May-2024. it should give sum as (Current YTD (1-Apr-24 to 1-May-24) & (Last Year YTD 1-Apr-23 to 1-May-23)
board_sub_grouping
reporting
Current year YTD
Last year YTD
—
—
—
—
Policy Issuance
Medical iTerm
2223.00
300
This is my data using which I want to achieve YTD sum by selecting single date in the filter.
e.g. Add date parameter on Month1 when I choose 1-May-2024. it should give some as (Current YTD (1-Apr-24 to 1-May-24) & (Last Year YTD 1-Apr-23 to 1-May-23)
I don’t think that a YTD is what you want. What you describe is more a rolling sum (including previous year comparison). Please correct me if I am wrong.
I created a date parameter, where you can pick a date.
The first calculation (Sales (Parameter to -1y)) calculates the Sales (please use your meassure here eg. Policy Issuance) for the order date between your selected date and your selected date minus one year.
Hi @Lobhas, to achieve the Year-to-Date (YTD) sum calculation using a single date filter, you can try this approach – or if it’s too many steps, I would recommend handling the logic in pre-processing at the dataset or custom SQL or the above solution from Nico.
Create a Date Parameter:
Open your analysis in QuickSight.
Create a new parameter by going to the “Parameters” section and clicking “Create one”. Name it SelectedDate, set its data type to Date, and choose a default value.
Create Calculated Fields for Current Year and Last Year:
This approach can allow you to dynamically filter and calculate the YTD sums for both the current and last year based on the selected date parameter in QuickSight.
Did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community!
Also, check out the list of QuickSight Functions and this forum:
In case you need further assistance with your problem, please create a sample dashboard with sample dataset showing your problem state using Arena and please create a new post, so we can look at it from a fresh perspective. (Details on using Arena can be found here - QuickSight Arena)