Forum Discussion
Jan_Trummel
3 years agoHelper IV
Read out the last valid value
Hello community, I need a measure that always reads the last valid value from a table. I have the following data in my table Factors: As you can see, I don't have a factor in my table f...
amitchandak
3 years agoSuper User
Jan_Trummel , Try like
CALCULATE(
LASTNONBLANK(DimDate[Date],[Sum Factors]),
FILTER(
ALL(DimDate[Date]),
DimDate[Date] <= max(DimDate[Date])
)
)
Else you have to create a table using generate
Table 2 = GENERATE(ADDCOLUMNS('Table', "Next", COALESCE( minx(filter('Table', [Column1] >EARLIER('Table'[Column1])), [Column1]),TODAY())), GENERATESERIES([Column1], [Next]))Jan_Trummel
3 years agoHelper IV
Hello amitchandak and thanks a lot for your answer!
I slightly adjusted the measure by using LASTNONBLANKVALUE instead of LASTNONBLANK.
Factor every das=
CALCULATE(
LASTNONBLANKVALUE(
DimDate[Date],
[Sum Factors]
),
FILTER(
ALL(DimDate[Date]),
DimDate[Date] <= MAX(DimDate[Date])
)
)
The reason is that LASTNONBLANK gives the date but I need the result of [Sum Factors].
The measure also works very well in the demo data. In the production system, however, the calculation still takes a relatively long time. Do you have any other ideas?