Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Folks,
I have 3 years of data in my dataset, 2022, 2023 complete year and 2024 till today i.e., (05/09/2024). I want to calculate YoY growth.
When I choose 2024 in slicer, it should show CY till the present day and PY should show the sameperiod sales (sameperiodlastyear won't work because it will consider complete May month when compared to last year)
When I choose 2023 in slicer, it should show the complete 2023 in CY and 2022 in PY sales.
Please advise the dax.
Thanks
Solved! Go to Solution.
@Ahmedx , I used your calculation but not able to get desired results.
Sales YTD should present all values for 2023, and LastYEARYTD should present values less than Oct 1 for 2022, as we have data till Oct 2023. For 2022, LastYearYTD present values till July 2022 not for december 2022.
Power BI file attached, please help.
Best Regards,
Fahad Qadir
@Ahmedx SalesYTD for 2022 should be blank as I select 2023 and 2022, and LastYear YTD for 2023 should be blanks.
LastYear YTD for 2022 should presents all values less than Oct 1 2022, as we have 1st Oct 2023 is the max(last) date in 2023.
is it possible? Thanks alot for your response.
you can try
var CY = [measure]
var Py = calculate ([measure],all(date),date(date)>=date(year-1,1,1) && date<=Edate(date ,-12))
User | Count |
---|---|
94 | |
86 | |
78 | |
70 | |
63 |
User | Count |
---|---|
114 | |
99 | |
97 | |
65 | |
59 |