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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.