cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper III

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
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

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

Announcements

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Top Solution Authors
Top Kudoed Authors