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
Anonymous
Not applicable

Data filtering based on higher value in column

Hello all,

 

I would like to filter the table below based on the higher value in the Order ID for each row where the Unique ID is matching.

The table below represents a history that's why there is the same Unique ID for rows, however, the higher value of Order ID means that it's the latest output. 

 

AA IDDB IDStatusOrder IDUnique ID
11112222Failed100123456
11112222Finished101123456
22223333Exception110234567
22223333Rescan111234567
22223333Finished112234567
33331234Exception120987654

 

As an output table from the example above I would have:

 

AA IDDB IDStatusOrder IDUnique ID
11112222Finished101123456
22223333Finished112234567
33331234Exception120987654

 

Thanks for your help! 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Create a new table with the following filter:

Filtered Order Table = 

FILTER(
    Table2,
    var __maxorder = CALCULATE( MAX(Table2[Order ID]) , ALLEXCEPT( Table2 , Table2[AA ID] )) return
    Table2[Order ID] = __maxorder
)

Fowmy_0-1622011225402.png

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

Create a new table with the following filter:

Filtered Order Table = 

FILTER(
    Table2,
    var __maxorder = CALCULATE( MAX(Table2[Order ID]) , ALLEXCEPT( Table2 , Table2[AA ID] )) return
    Table2[Order ID] = __maxorder
)

Fowmy_0-1622011225402.png

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thank you, that works perfectly.

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.

Top Solution Authors