Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SzymonKl
Helper I
Helper 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 

SzymonKl_0-1686133991977.png

 

, then selecting Standard Type 2 (39) gets 800 which is also correct.

SzymonKl_1-1686134046253.png

 

However, when selecting two possibilities, Power Bi returns the result of one.

SzymonKl_2-1686134137785.png

 

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
1 REPLY 1

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.