Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
icturion
Resolver II
Resolver II

Dif in perc. between AC en PY

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 )

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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]))

 

vjaywmsft_0-1656574033249.png

 

Best Regards,

Jay

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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]))

 

vjaywmsft_0-1656574033249.png

 

Best Regards,

Jay

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors