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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Aymeric_2350
Frequent Visitor

How do I find the latest date on a row?

Hi all,
Very new to power BI but trying to wrap my head around this one ...

I'm trying to get the latest date registered across different columns for each row separately.

Each line corresponds to an item that has several stages of completion but what I'm trying to get is the last date on which any of those stage was completed.

I'm not sure how to write the formula for that ... in excel, I would use something like =MAX(B2:I2) but it doesn't seem to work and I have some columns in the middle with non-date related content so that might be playing up in my issue ...

Thanks in advance !

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Power Bi is better at dealing with Columns rather than rows so you could Unpivot the date columns in Power Query and write a simple MAX measure or

Add a column in Power Query using List.Max() .  You would pass it a list of the column names.

-

If you want to keep the data in the original format and get a DAX solution, you would have to compare the values of each column with a lengthy series of comparisons.  Not ideal but I have seen code on the forum to do it.

View solution in original post

2 REPLIES 2
Aymeric_2350
Frequent Visitor

I ended up going with the lengthy comparison as I couldn't work out how to have the calculation based on the transposed data to change column for each following row if that makes sense ?

HotChilli
Super User
Super User

Power Bi is better at dealing with Columns rather than rows so you could Unpivot the date columns in Power Query and write a simple MAX measure or

Add a column in Power Query using List.Max() .  You would pass it a list of the column names.

-

If you want to keep the data in the original format and get a DAX solution, you would have to compare the values of each column with a lengthy series of comparisons.  Not ideal but I have seen code on the forum to do it.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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