Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi, I have this tree of conditions:
and I traduce it to Power BI using the fields:
| TotalData[Fiscal Year]="FY19" && TotalData[WBS Status]="CLS" && TotalData[Total]<100 && TotalData[Status]="NO" ,"Green", |
| TotalData[Fiscal Year]="FY19" && TotalData[WBS Status]="CLS" && TotalData[Total]>100 && TotalData[Status]="NO" ,"Green", |
| TotalData[Fiscal Year]="FY19" && TotalData[WBS Status]="CLS" && TotalData[Total]<100 && TotalData[Status]="YES" ,"Green", |
| TotalData[Fiscal Year]="FY19" && TotalData[WBS Status]="CLS" && TotalData[Total]>100 && TotalData[Status]="YES" ,"Green", |
| TotalData[Fiscal Year]="FY19" && TotalData[WBS Status]="REL" && TotalData[Total]<100 && TotalData[Status]="NO" ,"Yellow", |
| TotalData[Fiscal Year]="FY19" && TotalData[WBS Status]="REL" && TotalData[Total]>100 && TotalData[Status]="NO" ,"Red", |
| TotalData[Fiscal Year]="FY19" && TotalData[WBS Status]="REL" && TotalData[Total]<100 && TotalData[Status]="YES" ,"Green", |
| TotalData[Fiscal Year]="FY19" && TotalData[WBS Status]="REL" && TotalData[Total]>100 && TotalData[Status]="YES" ,"Green", |
| TotalData[Fiscal Year]="FY20" && TotalData[WBS Status]="CLS" && TotalData[Total]<10 && TotalData[Status]="NO" ,"Green", |
| TotalData[Fiscal Year]="FY20" && TotalData[WBS Status]="CLS" && TotalData[Total]>10 && TotalData[Status]="NO" ,"Red", |
| TotalData[Fiscal Year]="FY20" && TotalData[WBS Status]="CLS" && TotalData[Total]<10 && TotalData[Status]="YES" ,"Green", |
| TotalData[Fiscal Year]="FY20" && TotalData[WBS Status]="CLS" && TotalData[Total]>10 && TotalData[Status]="YES" ,"Green", |
| TotalData[Fiscal Year]="FY20" && TotalData[WBS Status]="REL" && TotalData[Total]<10 && TotalData[Status]="NO" ,"Yellow", |
| TotalData[Fiscal Year]="FY20" && TotalData[WBS Status]="REL" && TotalData[Total]>10 && TotalData[Status]="NO" ,"Red", |
| TotalData[Fiscal Year]="FY20" && TotalData[WBS Status]="REL" && TotalData[Total]<10 && TotalData[Status]="YES" ,"Green", |
| TotalData[Fiscal Year]="FY20" && TotalData[WBS Status]="REL" && TotalData[Total]>10 && TotalData[Status]="YES" ,"Green", |
Which is the best practice to make the IF condition and generate a calculated column?
Thanks!
Solved! Go to Solution.
Hey @Anonymous
You can use the AND and OR functions or even embed IF statements in Power BI just like you can in excel if you have an if function with multiple criteria.
AND: https://docs.microsoft.com/en-us/dax/and-function-dax
OR: https://docs.microsoft.com/en-us/dax/or-function-dax
Depending on your situation you may also want to consider the SWITCH function: https://docs.microsoft.com/en-us/dax/switch-function-dax
Examples: https://community.powerbi.com/t5/Desktop/DAX-Measure-with-Nested-IF-Statements/td-p/113358
https://stackoverflow.com/questions/40254578/multiple-if-statements-in-dax
If this helps please kudo.
If this solves your problem please accept it as a solution.
Hi @Anonymous ,
Please try this:
Scorecard Status =
IF (
OR ( 'TotalData'[Fiscal Year] = "FY19", 'TotalData'[Fiscal Year] = "FY20" )
&& 'TotalData'[WBS Status] = "REL"
&& 'TotalData'[Total] < 100
&& 'TotalData'[Status] = "NO",
"Red",
(
IF (
OR ( 'TotalData'[Fiscal Year] = "FY19", 'TotalData'[Fiscal Year] = "FY20" )
&& OR ( 'TotalData'[WBS Status] = "CLS", 'TotalData'[WBS Status] = "REL" )
&& 'TotalData'[Total] > 100
&& 'TotalData'[Status] = "NO",
"Yellow",
"Green"
)
)
)Best Regards
Rena
Hey @Anonymous
You can use the AND and OR functions or even embed IF statements in Power BI just like you can in excel if you have an if function with multiple criteria.
AND: https://docs.microsoft.com/en-us/dax/and-function-dax
OR: https://docs.microsoft.com/en-us/dax/or-function-dax
Depending on your situation you may also want to consider the SWITCH function: https://docs.microsoft.com/en-us/dax/switch-function-dax
Examples: https://community.powerbi.com/t5/Desktop/DAX-Measure-with-Nested-IF-Statements/td-p/113358
https://stackoverflow.com/questions/40254578/multiple-if-statements-in-dax
If this helps please kudo.
If this solves your problem please accept it as a solution.
Thanks! with SWITCH function is working, I just validate it.
🙂
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 51 | |
| 42 | |
| 25 | |
| 22 |
| User | Count |
|---|---|
| 139 | |
| 116 | |
| 54 | |
| 37 | |
| 31 |