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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Euro0681
Helper II
Helper II

Previous Year Sum

again another simple question but maybe im over thinking it. 
I'm wanting to calculate the SUM('Table'[Sales]) (At a given time) for the previous year at a given quarter,
I guess my confusion is what if we are not using dates in the visualization itself how could i do this?
I have created a measure:
= Calculate(
               Sum('Table'[Sales]),

               DateAdd('Table'[Date], -1, YEAR),

               'Table'[Quarter] = "Q4"

   )

when inserting into the visual it just returns all sales (im assuming because there is no context specifying the date)
So my thought is to maybe include TODAY() but then what if a year on a slicer how would it then work? 

1 REPLY 1
FreemanZ
Super User
Super User

Time intelligence helps shifting calculation period. With this code, to show the Q4 of the previous year, you need somewhere in your visual with the context of Q4 of this year. 

 

= Calculate(
               Sum('Table'[Sales]),

               DateAdd('Table'[Date], -1, YEAR)

   )

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.