Forum Discussion
cumulative index
First post on the forum, so forgive me if I am not following forum rules. I'm very new to Power BI DAX formulas, and creating a cumulative total measure is prooving very difficult. I've read several threads on this site and others, but so far I can't seem to make it work the way it should. Here is the RunningTotal measure formula I've written:
RunningTotal =
CALCULATE (
SUM ( 'Curve Comparison Files'[2017Q1] ),
FILTER (
ALLSELECTED ( 'Curve Comparison Files'[2017Q1] ),
min('Curve Comparison Files'[Normalized Days]) <= MAX ( 'Curve Comparison Files'[Normalized Days] )
)
)
This is just returning the same data that was entered in. I'm guessing it's summing all data within the same day, which is just the one single datapoint. Any suggestions?
Try this one please
RunningTotal = CALCULATE ( SUM ( 'Curve Comparison Files'[2017Q1] ), FILTER ( ALLSELECTED ( 'Curve Comparison Files' ), 'Curve Comparison Files'[Normalized Days] <= MAX ( 'Curve Comparison Files'[Normalized Days] ) ) )
3 Replies
- Zubair_Muhammad
Community Champion
Please Try this one
RunningTotal = CALCULATE ( SUM ( 'Curve Comparison Files'[2017Q1] ), FILTER ( ALLSELECTED ( 'Curve Comparison Files' ), 'Curve Comparison Files'[Normalized Days] ) <= MAX ( 'Curve Comparison Files'[Normalized Days] ) )- BEverettFrequent Visitor
It's giving me an error message:
"A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
- Zubair_Muhammad
Community Champion
Try this one please
RunningTotal = CALCULATE ( SUM ( 'Curve Comparison Files'[2017Q1] ), FILTER ( ALLSELECTED ( 'Curve Comparison Files' ), 'Curve Comparison Files'[Normalized Days] <= MAX ( 'Curve Comparison Files'[Normalized Days] ) ) )