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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors