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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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