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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.