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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
lscoffield
Frequent Visitor

Create a new table with latest row

 

I have a table that records activities session_id and a timestamp. (see diagram) I would like to create a table with only the latest entry for each session_id. The rows marked in yellow. Can someone please help.

 

Capture.PNG

3 REPLIES 3
v-jiascu-msft
Employee
Employee

Hi @lscoffield,

 

 

Could you please mark the proper answers as solutions?

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @lscoffield,

 

You also can add create a measure and add it in the Visual Level filter and filter out the blanks.

Measure =
VAR maxTimeStamp =
    CALCULATE (
        MAX ( 'table'[timestamp] ),
        ALLEXCEPT ( 'table', 'table'[session_id] )
    )
RETURN
    IF ( MIN ( 'table'[timestamp] ) = maxTimeStamp, 1, BLANK () )

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
davehus
Memorable Member
Memorable Member

Hi, 

 

In Powerbi Select Modelling > New Table and try the code below.

 

Last Date = SUMMARIZE('Your Table', 'Your Table'[Session ID], "Last Date", MAX('Your Table'[TimeStamp]))

HTH

 

D

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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