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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
RobRayborn
Helper IV
Helper IV

Running Totals of a Measure

First of all, I am calculating the Day over Day difference % using the DAX Measure below. My problem is now I need to create a rolling cumulitive total starting from the frist date provided to the last date entered.  The DAX measure = CALCULATE( PD % Diff, Filter,(ALLSELECTED( fDates ), fDates [Date] <= Max ( fDate[Dates]))) isn't providing me with a daily running cumulitive total.  What am I missing here?

 
 
 
PD % Diff =
VAR _currentdate =
    MAX ( fDates[Date] )
VAR _lastnonblank =
    CALCULATE (
        LASTNONBLANK ( fDates[Date], [Inventory Value LC] ),
        FILTER ( ALL ( fDates[Date] ), fDates[Date] < _currentdate )
    )
VAR _lastnonblankvalue =
    CALCULATE ( [Inventory Value LC], fDates[Date] = _lastnonblank )
RETURN
    IF (
        NOT ISBLANK ( [Inventory Value LC] ) && HASONEVALUE ( fDates[Date] ),
        DIVIDE ( [Inventory Value LC] - _lastnonblankvalue, _lastnonblankvalue )
    )
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@RobRayborn ,Assuming fDates is a date table

 

CALCULATE( Sumx(Values(fDates [Date]), [PD % Diff]) , Filter,(ALLSELECTED( fDates ), fDates [Date] <= Max ( fDate[Dates])))

 

 

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

 

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

1 REPLY 1
amitchandak
Super User
Super User

@RobRayborn ,Assuming fDates is a date table

 

CALCULATE( Sumx(Values(fDates [Date]), [PD % Diff]) , Filter,(ALLSELECTED( fDates ), fDates [Date] <= Max ( fDate[Dates])))

 

 

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

 

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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.