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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Experts
Cannot see the error in my if formula.
Hi @Anonymous
highky recommend to use SWITCH() as mentioned @mahoneypat
_Status =
SWITCH(TRUE(),
ScheduleTask[status]="Complete", "Complete",
ScheduleTask[status]="Cancelled","Cancel",
ScheduleTask[status]="Active" && ScheduleTask[primaryAuthor]="", "Unassigned",
ScheduleTask[status]="Active" && ScheduleTask[primaryAuthor]<>"", "Assigned",
ScheduleTask[status]="Active" && ScheduleTask[LifecycleStatusMatch]="", "inProgress",
ScheduleTask[LifecycleStatusMatch]
)
@Anonymous, I think you should like
_Status = IF(ScheduleTask[status]="Complete", "Complete",IF(ScheduleTask[status]="Cancelled","Cancel",
IF( (ScheduleTask[status]="Active",ScheduleTask[primaryAuthor]=""),"Unassigned",
IF( (ScheduleTask[status]="Active",ScheduleTask[primaryAuthor]<>""),"Assigned",
IF( ScheduleTask[status]="Active",ScheduleTask[LifecycleStatusMatch]=""),"inProgress",ScheduleTask[LifecycleStatusMatch]))))
I doubt use of AND
Hi Amit
its giving me errors with out the and....
Did you consider writing this as a SWITCH(TRUE(),... expression instead of nested IF()s? Check out this post.
https://powerpivotpro.com/2015/03/the-diabolical-genius-of-switch-true/
Not sure if you want to rewrite this one but it will make the next one easier.
Regards
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
hi Pat
not sure that is going to work its a calculated column in a table, my faut forgot to mention that.
Switch(true() works in calculated columns too. Here is what it your expression would look like with that approach:
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |