Forum Discussion
siddhantk989
9 years agoHelper III
If Statement in DAX
Hi, I am generating a custom filter based on my column values Sales and Units. So for this I am using IF statement to select between Sales and Units. Now it is working fine if the user selects...
- 9 years ago
Here are revised formula:
Display Quantity = if(OR(hasonevalue('Show Data By'[Show Data])=False ,values('Show Data By'[Show Data])="Qty"), SUM(Sales[Quantity]), BLANK()) Display Revenue = if(OR(hasonevalue('Show Data By'[Show Data])=False ,values('Show Data By'[Show Data])="Revenue"), SUM(Sales[Revenue]), BLANK())I used by own data coloumn, you can change it to your own. I tested at my end it works, if need with your own columns, i will do it for you.
- 9 years ago
I hope this will work:
Display Quantity = if(contains('Show Data By','Show Data By'[Show Data],"Qty"), SUM(Sales[Quantity]), BLANK()) Display Revenue = if(contains('Show Data By','Show Data By'[Show Data],"Revenue"), SUM(Sales[Revenue]), BLANK())
parry2k
9 years agoSuper User
I hope this will work:
Display Quantity = if(contains('Show Data By','Show Data By'[Show Data],"Qty"), SUM(Sales[Quantity]), BLANK())
Display Revenue = if(contains('Show Data By','Show Data By'[Show Data],"Revenue"), SUM(Sales[Revenue]), BLANK())siddhantk989
9 years agoHelper III
It is working completely fine. Thanks again