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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
pbidemouser2
Helper II
Helper II

How to show only the latest data for each timestamp

 Hi all,

 

I am working with a live data connection which gets data in a hourly basis. I am facing difficulties in using DAX. I have a dataset similar to the one below.

Timestamp      Value

15/06/2020 1:00    10

15/06/2020 1:00     12

15/06/2020 1:00    15

15/06/2020  2:00    11

15/06/2020  2:00    13

 

I want to show only the last value for each timestamp. For ex., i want the output to show as below,

Timestamp    Value

15/06/2020 1:00   15

15/06/2020 2:00    13

 

Could someone pls suggest a way to do this?. Since this is a live connection i couldnt use the query editor. Is there any measure for this. After this, I want to plot the timestamp vs Value in the form of a line plot.

 

 

Thanks,

@amitchandak @parry2k @Greg_Deckler 

1 ACCEPTED SOLUTION

Hi @pbidemouser2 ,

 

This is very strange.

Are you saying that you can‘t use the [Timestamp] column in the LASTNONBLANKVALUE() function?

What error did you encounter?

Please send a screenshot of your error message.

 

Or try this measure formula.

Measure 3 = 
CALCULATE(
    MAX(Sheet4[Value]),
    ALLEXCEPT(Sheet4, Sheet4[Timestamp] )
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@pbidemouser2 , Try if this can help

LASTNONBLANKVALUE(Table[timestamp],sum(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

Timestamp is not a measure here @amitchandak 

Hi @pbidemouser2 ,

 

Please refer to the below formula.

jjj3.PNGjjj4.PNG

Measure 2 = 
LASTNONBLANKVALUE(
// the name of my table is 'Sheet4'
    Sheet4[Timestamp],
    MAX( Sheet4[Value] )
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

HI @v-lionel-msft ,

I tried the measure u told. The Sheet4[Timestamp] part doesnt work. 

 
 

Capture.PNG

Since the Timestamp column isnt a measure here, i couldnt use it in this. Could you pls suggest me what to do?

 

Thanks

Hi @pbidemouser2 ,

 

This is very strange.

Are you saying that you can‘t use the [Timestamp] column in the LASTNONBLANKVALUE() function?

What error did you encounter?

Please send a screenshot of your error message.

 

Or try this measure formula.

Measure 3 = 
CALCULATE(
    MAX(Sheet4[Value]),
    ALLEXCEPT(Sheet4, Sheet4[Timestamp] )
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-lionel-msft ,

This measure shows the max value of each timestamp, not the latest one. Is there any other way to find the latest one?

 

Thanks

Thanks @v-lionel-msft , this measure worked

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors