Forum Discussion
Need Help with DAX Measure
Hi Power BI Community,
I need help in Writing a DAX measure.
I have 2 measures A, B and a Slicer Column C.
If No Value or All or selected from Slicer, it should take value from Measure A else from Measure B.
Thanks in advance.
Hi, Anonymous
You can try:
measure = SWITCH ( TRUE (), DISTINCT ( Input[Customer] ) = BLANK () || DISTINCT ( Input[Customer] ) = DISTINCT ( ALL ( Input[Customer] ) ), SUM ( Input[Customer Mix] ), [Fx Customer Mix] )Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
7 Replies
- BA_Pete
Super User
Hi Anonymous ,
Try this measure:
_variableOutput = IF( HASONEVALUE(slicer[column C]), [measure B], [measure A] )Pete
- gabrielreversiFrequent Visitor
Hi Anonymous
what do you look for would be that way?
- AnonymousNot applicable
Hi Power BI Community,
If All Values or No Values are selected from Customer Slicer, the above table should use Customer Mix Column, else it should use Fx Customer Mix Column.
Please help, thanks in advance.
Thank you
Kuber Kumar
- gabrielreversiFrequent Visitor
Hi Anonymous
You use next measure:
measure =
SWITCH(TRUE,
ISFILTERED(table[customer]), [Fx Customer Mix], [Customer Mix])
- v-janeyg-msft
Community Support
Hi, Anonymous
You can try:
measure = SWITCH ( TRUE (), DISTINCT ( Input[Customer] ) = BLANK () || DISTINCT ( Input[Customer] ) = DISTINCT ( ALL ( Input[Customer] ) ), SUM ( Input[Customer Mix] ), [Fx Customer Mix] )Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.