Forum Discussion
Anonymous
4 years agoNot applicable
Need Help in a calculated field
Hi All,
I want to replicate the below formula in Power bi , Can anyone please help me .
IF [Alliance Fit]="General Fit" THEN [Play Fit]
ELSEIF [Alliance Fit]="Azure Alliance Fit" THEN [Azure Alliance Fit]
ELSEIF [Alliance Fit]="GCP Alliance Fit" THEN [GCP Alliance Fit]
ELSE [Play Fit]
END
Thanks & Regrards
Shiv Kumar
I presume you are asking for a DAX formula. You can use SWITCH
= SWITCH([Alliance Fit],"General Fit",[Play Fit],"Azure Alliance Fit",[Azure Alliance Fit],"GCP Alliance Fit",[GCP Alliance Fit],[Play Fit])
3 Replies
- Vijay_A_VermaMost Valuable Professional
I presume you are asking for a DAX formula. You can use SWITCH
= SWITCH([Alliance Fit],"General Fit",[Play Fit],"Azure Alliance Fit",[Azure Alliance Fit],"GCP Alliance Fit",[GCP Alliance Fit],[Play Fit]) - wdx223_DanielCommunity Champion
NewCalculatedColumn=SWITCH(TRUE(), [Alliance Fit]="General Fit",[Play Fit],
[Alliance Fit]="Azure Alliance Fit", [Azure Alliance Fit],
[Alliance Fit]="GCP Alliance Fit" ,[GCP Alliance Fit],
[Play Fit]) - mussaendaCommunity Champion
Hi Anonymous ,
If you want in Power Query,
Please try below:
try if Text.Upper([Alliance Fit]) = "GENERAL FIT" then [Play Fit] else if Text.Upper([Alliance Fit]) = "AZURE ALLIANCE FIT" then [Azure Alliance Fit] else if Text.Upper([Alliance Fit]) = "GCP ALLIANCE FIT" then [GCP Alliance Fit] else [Play Fit] otherwise [Play Fit]