Forum Discussion

rommel20's avatar
rommel20
Icon for Resolver I rankResolver I
9 years ago
Solved

DAX Grouping (tagging)

Need help, I need to tagged record if retain or removed based on its status and it grouping But  the rules are   1: For each Unit, filter out Pros records if there exists an Exec record 2: ...
  • v-chuncz-msft's avatar
    9 years ago

    rommel20,

     

    You may check if RANKX Function works.

    Rules (tagging) =
    VAR Rnk =
        RANKX (
            CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[Property], Table1[Unit] ) ),
            SWITCH ( Table1[Status], "Exec", 1, "Pros", 2, "Vacant", 3 ),
            ,
            1
        )
    RETURN
        IF ( Rnk = 1, "Record remains", "Record removed" )