Forum Discussion
Neko12
4 years agoRegular Visitor
IF ELSE vs SWITCH for multiple years
I am trying to do a ratio-based calculation using DAX in Power BI. Say, the column name is [2023 Cost],[2022 Cost],[2021 Cost], [YYYY Cost] and there is a fixed value: [Target Cost] What is t...
Neko12
4 years agoRegular Visitor
Thanks amitchandak for the info.
However, the value is not calculated - it shows text as results (eg: 'Group 1', 'Group 2')
I'm looking for a DAX expression.
For example:
CostRatio = (Is it IF/ SWITCH) ........ [2023 Cost] is not blank, then the result is [2023 Cost]/[Target Cost],
if not, then [2022 Cost]/[Target Cost],
if not then 0
Thanks