Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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! 

  • 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
    )
    

     

     



2 Replies

  • 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
    )
    

     

     



    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you, that works perfectly.