Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Conditional Calculated Column with Groupings

Hello everyone, I am still new to DAX and I have a situation here that I've been looking to solve for a few days.   I have a table below and I am trying to populate Account_Status. The logic is bas...
  • v-xuding-msft's avatar
    6 years ago

    Hi Anonymous ,

    Please try like this:

     

    Account_Status =
    VAR CountActive =
        CALCULATE (
            COUNTROWS( 'Table' ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Unique_ID] ),
                'Table'[Product_Subscription] = "Active"
            )
        )
    RETURN
        IF ( CountActive > 0, "Active", "Inactive" )