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
united2win
Helper III
Helper III

How to take the latest row in a Power Bi table?

Hi,

 

I have the following table in one of my power bi reports:

 

Client CountryPeriod YearNot Filed ReasonStatus Change
Client ADEJan2019Reaosn C13/11/2019
Client ADEJan2019Reason B13/02/2019
Client ADEJan2019Reason A04/01/2018

 

I would like to be able to only return the lastest status in that table?

 

 

8 REPLIES 8
Felix_Schulte
New Member

Can someone please answer this simple question?

united2win
Helper III
Helper III

Here are the two tables in my power bi report:

 

Table 1:

Capture.PNG

 

Table 2:

 

Capture2.PNG

 

On table 1 I have managed to merge the latest date using the concatenate column. I am only missing the associated reason... 😞

 

 

HI @united2win ,

Do you mean to add a column to 'table 1' to use current 'concatenate' field value to search corresponds max date from 'table 2'?

If this is a case, you can refer to the following calculated column:

Related Max Date =
CALCULATE (
    MAX ( Table2[Status Change] ),
    FILTER (
        ALLSELECTED ( Table2 ),
        [ConcateNate] = EARLIER ( Table1[Concatenate] )
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi,

 

I have transferred the calculation and that given me the latest date, but I also need the corresponding reason. 

 

Capture.PNG 

 

Seperately, I managed to get this by "Merging Queries" and using two variables the Date Change and the Concatenate. Would you say this is relaible?

 

HI @united2win ,

#1, You can use 'last date' and concentrate label to find out correspond reason from tabel2.

#2, Yes, it is reliable. You can take a look at the following blog about relationship with multiple columns:

Relationship in Power BI with Multiple Columns 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

HI @united2win ,

Maybe you can try to set up a filter with 'topn' mode on status change fields or write measure formula to get the last date based on category fields and compare with the current date to return tag, then apply on visual level filter.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

The reason why I need the latest status change is because I have another independent table, which I want to merge like this. 

Return ManagerFiledConcantenateNot Filed ReasonStatus Change
Jim SlaterNoDE-Jan-2019Reason C13/11/2019
     
     

 

I will also add another coloumn in the previous table to concatenate the country, period & year in order to create a common key.

 

 

 

 

Jorgast
Resolver II
Resolver II

Have you tried determining the most recent date using the MAX function? 

 

Most Recent Change = Max (Table[Status Change])

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.