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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Rolling total not working for delta calculated by measure

Hi all,

 

I have the following measure which calculates the delta of the average value of last quarter and the average value of the qurrent quarter. The table contains the value per day, and needs to be averaged by quarter.

 

ValueDelta =

VAR CURRENTQ = AVERAGE(Table[Value])

VAR PREVQ = CALCULATE(AVERAGE(Table[Value]),PREVIOUSQUARTER(DateTable[Date]))

 

RETURN

IF(ISBLANK(PREVQ) || ISBLANK(CURRENTQ),BLANK(),

ABS(PREVQ - CURRENTQ)

)

 

Resulting in the following metrics:

 

YearQuarterValueDelta
20221970
202221.603
20223946
20224920
202311.073
202321.341
20233915
20234920

 

Now I'd like to calculate the rolling total for 'ValueDelta' like this:

 

YearQuarterValueDeltaRolling total
20221970 
202221.6032.573
202239463.519
202249204.439
202311.0735.512
202321.3416.853
202339157.768
202349208.688

 

I've tried multiple suggestions online like:
https://community.powerbi.com/t5/Desktop/Cumulative-Total/td-p/43115
https://www.daxpatterns.com/cumulative-total/ 

https://www.sqlbi.com/articles/computing-running-totals-in-dax/

 

For me these just return the same 'ValueDelta' value or blanks.

 

Any ideas or directions would be very helpful!

Thanks in advance.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

calculate(sumx(values(DateTable[Year Qtr]),[ValueDelta]), filter(AllSelected(DateTable), DateTable[Date]<=max(DateTable[Date])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

calculate(sumx(values(DateTable[Year Qtr]),[ValueDelta]), filter(AllSelected(DateTable), DateTable[Date]<=max(DateTable[Date])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

This works! thank you so much, was really struggling. 

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.