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
user9394
Microsoft Employee
Microsoft Employee

unable to get previous year measure of a sumx that has other conditions

I'm trying to create a sum measure but but at a prior year time frame.

 

Here are my measures I'm using.
Basic summation

 

sumMeasure = SUM(t1[measure])

 

 

I need to use this formula because I want to sum my sumMeasure, but not have it affected by the Baseline Date. This Date is used to control other measuers

 

currentSum = SUMX(ALL(__BaseDateTable[Baseline Date]),[sumMeasure])

 

I thought I would then be able to just follow with this one below to get the previous date

 

CALCULATE(SUM(currentSum, PREVIOUSYEAR('Time'[DateKey]))

 

 but the sum fuction does not take the currentSum as an argument and wants a column, not a measure.

 

Is there an alternative way to do this, keeping my currentSum formula?

3 REPLIES 3
Anonymous
Not applicable

HI @user9394,

Perhaps you can try to use date function to manually define the filter range instead of time intelligence functions:

ime Intelligence "The Hard Way" (TITHW)  

Regards,

Xiaoxin Sheng

Ashish_Mathur
Super User
Super User

Hi,

Create a relationship (Many to One and Single) from the _Baseline Date column of the _BaseDataTable to the Date column of the Calendar Table.  Drag Year from the Time table and select a Year there.  Write this measure

Measre for PY = calculate([measure],previousyear('time'[Date]))

Hope this helps. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
FreemanZ
Super User
Super User

hi @user9394 

try like

CALCULATE([currentSum], PREVIOUSYEAR('Time'[DateKey]))

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.