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
pbidemouser2
Helper II
Helper II

Show the last value of each timestamp group

Hii,

 

Can anyone help me out with this problem.

 

I have the below table

Timestamp      Value

15/06/2020 1:00    10

15/06/2020 1:00     15

15/06/2020 1:00    12

15/06/2020  2:00    11

15/06/2020  2:00    9

 

The output should be 

15/06/2020 1:00    12

15/06/2020  2:00    9

 

It should show only the last value of each unique dataset. I tried out this measure below, but it took the max value of each timestamp instead of the last one. Could someone pls help me with this?. 

 

 

@amitchandak @parry2k @az38 @v-lionel-msft 

1 ACCEPTED SOLUTION

@pbidemouser2 , try

 

Measure = LASTNONBLANKVALUE(lastvalue[index],MAX(lastvalue[Value]))
or
Measure 2 = sumx(SUMMARIZE(lastvalue,lastvalue[Timestamp],"_1",LASTNONBLANKVALUE(lastvalue[index],MAX(lastvalue[Value]))),[_1])

View solution in original post

8 REPLIES 8
Icey
Community Support
Community Support

Hi @pbidemouser2 ,

 

Is this problem solved?


If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.


If not, please let me know.

 


Best Regards,
Icey

amitchandak
Super User
Super User

@pbidemouser2 , Try

LASTNONBLANKVALUE(Table[Timestamp],max(table[Value]))

This doesnt work @amitchandak 

I couldnt view the pbix file u sent. It says "Object reference not set to an instance of an object". 

Also, i'm dealing with live data. So none of the power query methods works. Only creating measures is possible @amitchandak 

@pbidemouser2 , we need something else to find the last in the sequence where we have the same time. else we can only find min or max

Measure = LASTNONBLANKVALUE(lastvalue[Index],max(lastvalue[Value]))

Timestamp                     Index       Value

15/06/2020 1:00             1                10

15/06/2020 1:00              2              15

15/06/2020 1:00              3              12

15/06/2020  2:00             1              11

15/06/2020  2:00              2              9

 

If this is the dataset, then how to get the last value for each timestamp?

Outcome should be

15/06/2020 1:00  12

15/06/2020  2:00  9 

@amitchandak 

@pbidemouser2 , try

 

Measure = LASTNONBLANKVALUE(lastvalue[index],MAX(lastvalue[Value]))
or
Measure 2 = sumx(SUMMARIZE(lastvalue,lastvalue[Timestamp],"_1",LASTNONBLANKVALUE(lastvalue[index],MAX(lastvalue[Value]))),[_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.

Top Solution Authors
Top Kudoed Authors