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
Joseph_Hchaime
Helper III
Helper III

Dynamic Calculation: Sum of ALL previous years vs Sum of CURRENT YEAR

Hi,

 

I have a table with dates and an amount column. 

 

I want to create a dax measure that shows me the following: 

 

1) Measure One: Previous Years = Sum of Amount for ALL dates before current year
2) Measure 2: Current Year = Sum of Amount for ALL dates FOR the current year. 

 

I want it to be dynamic so next year, the currennt year will become previous year. etc

 

I THINK i have it covered for current year, (calculated YTD) but I can't find the function for summing up ALL previous years not just the most recent one. 

 

 

1 ACCEPTED SOLUTION
nvprasad
Solution Sage
Solution Sage

Hi Joseph,

 

Please try below DAX

 

CurrentYearSales/AllpreviousYearSales = 

Var CurrentYearStartDate = DATE(YEAR(TODAY()),1,1)
Var AllPrevisousYearsSales = CALCULATE([Sales Amount],'Date'[Date]<CurrentYearStartDate)
Var CurrentYearSales = CALCULATE([Sales Amount],'Date'[Date]>=CurrentYearStartDate)
RETURN DIVIDE(CurrentYearSales,AllPrevisousYearsSales,0)

Appreciate a Kudos! ‌‌
If this helps and resolves the issue, please mark it as a Solution! ‌‌

Regards,
N V Durga Prasad

 

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

View solution in original post

1 REPLY 1
nvprasad
Solution Sage
Solution Sage

Hi Joseph,

 

Please try below DAX

 

CurrentYearSales/AllpreviousYearSales = 

Var CurrentYearStartDate = DATE(YEAR(TODAY()),1,1)
Var AllPrevisousYearsSales = CALCULATE([Sales Amount],'Date'[Date]<CurrentYearStartDate)
Var CurrentYearSales = CALCULATE([Sales Amount],'Date'[Date]>=CurrentYearStartDate)
RETURN DIVIDE(CurrentYearSales,AllPrevisousYearsSales,0)

Appreciate a Kudos! ‌‌
If this helps and resolves the issue, please mark it as a Solution! ‌‌

Regards,
N V Durga Prasad

 

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors