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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
shellacademic
Frequent Visitor

How to get the latest status by id?

I have a table with Id, Status, DateTime amongst other columns.

 

I want to view a report of Id, LatestStatus. What is the best way to go about that?

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@shellacademic,

 

You may refer to the following DAX that creates a new table.

Table =
FILTER (
    Table1,
    RANKX (
        CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[Id] ) ),
        Table1[DateTime],
        ,
        DESC,
        DENSE
    )
        <= 1
)
Community Support Team _ Sam Zha
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

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@shellacademic,

 

You may refer to the following DAX that creates a new table.

Table =
FILTER (
    Table1,
    RANKX (
        CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[Id] ) ),
        Table1[DateTime],
        ,
        DESC,
        DENSE
    )
        <= 1
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-chuncz-msft I tried that but I get an error:

 

Fleshing out my problem a little more, I have imported the VSTS build information via the VSTS REST API into Power BI and have a table of Builds and BuildDefinitions. For each build definition I want to get the latest build information by looking at the max (BuildFinishTime).

 

What do I need to do to change my query?

 

Many thanks for your response.

@shellacademic,

 

I meant a calculated table.

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

Is there a way to do this using Direct Query? My data source has moved to a SQL Server database and I want to query the live data but now I can't create the calculated table. Is there a DAX equivalent or a way to have a calculated table with Direct Query?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Users online (11,919)