Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
In a card visual I want to show the percentage difference between the current year and the previous year in the same period. Now I have already calculated the number of the current year and previous in a measure. This calculation also works well in a table or graph with a date column.
The problem is that if I calculate the percentage difference and present it in a Card Visual, I get the percentage difference between 6 months in the current vs 12 months in the previous year. I would like to see the total difference over the current months of this year vs the same month period one year earlier.
does anyone know a solution for this?
My Measures;
# total = SUM(Sales[Amount])
# total PY = Calculate ([# total], DateADD('calendar'[date].[Date], -1, YEAR) ))
% AC vs PY = DIVIDE ( [# total] - # total PY, # total PY], 0 )
Solved! Go to Solution.
Hi @icturion ,
You could use SAMEPERIODLASTYEAR() function.
https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
total PY = CALCULATE(SUM('Table'[value]),SAMEPERIODLASTYEAR('Table'[date]))
Best Regards,
Jay
Hi @icturion ,
You could use SAMEPERIODLASTYEAR() function.
https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
total PY = CALCULATE(SUM('Table'[value]),SAMEPERIODLASTYEAR('Table'[date]))
Best Regards,
Jay
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.