Forum Discussion

SzymonKl's avatar
SzymonKl
Icon for Helper I rankHelper I
3 years ago

Last update in selected day

Can you please help me with Power Bi 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" , How can I change this measure to see the result for a selected day not the last one. However, if there was no update on the selected day, I want to see the last update before the selected date. For example, today is 15/06/2023, the update was done on the 10th and the result was =2, the next update was on the 13th and the score was 4. Because were no updates between 10 and 13 I want to see 10,11,12 with a score of =2( last update from 10th) and 13,14,15 with a score of 4. Just missing updates and overwriting the last one.

1 Reply

  • cThennakoon's avatar
    cThennakoon
    Frequent Visitor

    You can create a variable with a summarizecolumns table and filter it and return value based on your

    criteria