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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This doesnt work @amitchandak 

@pbidemouser2 , Only way out is index column as timestamp is the same

https://www.dropbox.com/s/0cdo0e5uf1nv5ss/lastvalue1.pbix?dl=0

 

https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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]))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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