I calculate cumulative sum using the following code and it works just fine:
CumulativeSum =
VAR CurrentIndex = 140304
VAR RunningTotal=
CALCULATE(
SUM(FactTable[ColumnA]),
FILTER(ALLSELECTED(DimIndex),
DimIndex[IndexKey] <= MAX (DimIndex[IndexKey])
)
)
RETURN
IF (
MAX(DimIndex[IndexKey]) <= CurrentIndex, RunningTotal, BLANK()
)
(results produced by this measure for Indexes greater than or equal to CurrentIndex are replaced by blank)
Here is the result (DarkBlue is non-cumulative values that come from another measure):
I have a table with a single column and a single row in the data model that stores CurrentIndex. when I try to get “140303” from this table using the following dax measure, the visual changes and does not show the desired result:
CumulativeSum =
VAR CurrentIndex = MAX(IndexTable[CurrentIndex])
VAR RunningTotal=
CALCULATE(
SUM(FactTable[ColumnA]),
FILTER(ALLSELECTED(DimIndex),
DimIndex[IndexKey] <= MAX (DimIndex[IndexKey])
)
)
RETURN
IF (
MAX(DimIndex[IndexKey]) <= CurrentIndex, RunningTotal, BLANK()
)
Here is the result:
How can I get the value of the CurrentIndex from the table in the data model and yet produce the Previous visual?
Thanks in advance