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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

Resolution the Problematic of Table

I need to calculate within this table the "winners" of the line based on three criteria:
1 - Highest total number of days (if they are equal)
2 - Larger date (if they are still the same)
3 - Higher order

05612287526_0-1643132077526.png

 

05612287526_1-1643132231423.png

 

4 REPLIES 4
Anonymous
Not applicable

In this case, it's not to look for the biggest of all and give only one result, it's to apply the criterion for each type of value of the column "ROW"

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

You can do this by performing three row selections (filters) in Power Query:

firstFilter =
Table.SelectRows(previousStep, each [Total de Dias] = List.Max(previousStep[Total de Dias]))

secondFilter =
Table.SelectRows(firstFilter, each [Dia Mais Recente] = List.Max(firstFilter[Dia Mais Recente]))

thirdFilter =
Table.SelectRows(secondFilter, each [Maior Ordem] = List.Max(secondFilter[Maior Ordem]))

 

You may be able to roll this into a single step but this lays out the principle most clearly.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

In this case, it's not to look for the biggest of all and give only one result, it's to apply the criterion for each type of value of the column "ROW"

Hi @Anonymous ,

 

This doesn't make sense to me. Your example output only shows one result.

Can you provide an example of your ACTUAL required output please?

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.