Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Everyone,
Im in need of help converting the below case statements to dax.
Case
WHEN ([SCODE]) = 47123
THEN((([Total Actual]+1350)+Case when isnull([Total Budget_Food]) then (-1*[Total Budget]) else [Total Budget_Food] END)/[Total ComparedOcc_FB]*[Max Negation])/((Case when isnull([Total Budget_Food]) then (-1*[Total Budget]) else [Total Budget_Food] END)/[Total Compared_Occ_FB])
ELSE(([Total Actual]+Case when isnull([Total Budget_Food]) then (-1*[Total Budget]) else [Total Budget_Food] END)/[Total Compared_Occ_FB]*[Max Negation])/((Case when isnull([Total Budget_Food]) then (-1*[Total Budget]) else [Total Budget_Food] END)/[Total Compared_Occ_FB])
END
Your assistance will be much appreciated.
Solved! Go to Solution.
@Anonymous , You can use Switch with True
example
Switch(True() ,
[SCODE]) = 47123 , [Total Actual]+1350 ,
isblank([Total Budget_Food]) , -1*[Total Budget],
divide([Total Budget_Food] END), [Total ComparedOcc_FB]*[Max Negation])
)
same way you can add another switch true
Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56
Hi @Anonymous,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
@Anonymous , You can use Switch with True
example
Switch(True() ,
[SCODE]) = 47123 , [Total Actual]+1350 ,
isblank([Total Budget_Food]) , -1*[Total Budget],
divide([Total Budget_Food] END), [Total ComparedOcc_FB]*[Max Negation])
)
same way you can add another switch true
Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
89 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |