Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Anti Right Join Dax Implementation

I am currently working with a dataset that has group pricing, meaning the customer's individual price is stored, but if they are part of a purchasing group, that price is also stored. I want the grou...
  • AlexisOlson's avatar
    5 years ago

    What if you filter your table to only return the row for each customer where the GROUPFLAG is minimal? I.e., the group price if it exists, but otherwise the customer price.

     

    FILTER (
        'Pricing Query',
        'Pricing Query'[GROUPFLAG]
            = CALCULATE (
                MIN ( 'Pricing Query'[GROUPFLAG] ),
                ALLEXCEPT ( 'Pricing Query', 'Pricing Query'[ABAN8] )
            )
    )