Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! 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.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.