Forum Discussion
SzymonKl
3 years agoHelper I
The Latest Value
Hi Users
Can you please help me with the measure?
I need to show the latest value where "state" is "Processed". For a single asset Description, this calculation works correctly, but when I try to select more Assets, it returns the last selected result (not summarizing). For example: selecting Standard Black 1 (37) gets 200 which is correct
, then selecting Standard Type 2 (39) gets 800 which is also correct.
However, when selecting two possibilities, Power Bi returns the result of one.
Do you know what could be the cause?
The measure :
SKLatest_ProcessedStock = Var Proccesed = SELECTEDVALUE(ASSET_LOGS[STATE])
Var LatestDateTime = CALCULATE(MAX(ASSET_LOGS[UPDATED_AT]),TREATAS({Proccesed},
ASSET_LOGS[STATE]))
Var Result = CALCULATE(VALUES(ASSET_LOGS_JSON[QUANTITY]),ASSET_LOGS[UPDATED_AT] = LatestDateTime)
Return Result