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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.