Forum Discussion
Anonymous
5 years agoNot applicable
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...
- 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] ) ) )
AlexisOlson
5 years agoSuper User
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] )
)
)Anonymous
5 years agoNot applicable
The above code worked for what I needed it to do, although I changed the MIN funciton to MAX. Thanks!