Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I know this might be an easy question, but I can't figure out.
I'm using this dax for getting all 2019 vaue.
2019 value=calculate('value'[total],DATEDD('Calendar'[Date],Calculate((YEAR(MAX('Calendar'[Date])) - 2019)*(-3)),YEAR))
and i want to calculate the ytd of 2019 by using dax below.
YTD 2019 = TOTALYTD('value'[2019 value],'Calendar'[Date])
I have a date slicer, from 2019 to 2023.
I wish to show the 2019 value when i press 2022 in the date slicer.
How should I modify the dax for 2019?
I will also need to calculate the percentage difference of 2019 and the year i select ytd.
Thanks for your help.
Hi,
Since you are calculating different years values with 2022 in the date slicer I recommend anchoring the date for your YTD. So something like this should do the trick:
End result:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Hi @ValtteriN,
That's working for bringing the value for entire 2020-2023, but are there any chance to using sameperiodlastyear or other dax formula that Jan to Dec will same as 2020 ytd Jan to Dec. Because the output value now is only the 2020 Dec value bring down to 2023.
Thanks for your help.
Hi,
You could add the month as a variable like this:
Proud to be a Super User!
Hi @ValtteriN,
After I adding thet code, that still same.
I wish to copy 2020 all value to 2021 which easier to make comparison between original 2021 value.
Thanks for your help.