Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
itimatic
Frequent Visitor

If else complex statement

Hello! Can anyone help in correcting this if statment? I'm getting error "Token Eof expected"Screenshot_22.png

IF [started_at] = NULL and [done] = NULL and [cancelled] = NULL then "Not started" else IF [started_at] != NULL and [done] = NULL and [cancelled] = NULL then "Ongoing" else IF [cancelled] != NULL then "Cancelled" else "N/A"

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

small "if".

I haven't looked at the logic but fix that first.

View solution in original post

4 REPLIES 4
itimatic
Frequent Visitor

Thanks for your hint,. it worked now. this is the final formula for reference:

if [started_at] = null and [done] = null and [cancelled] = null then "Not started"
else if [started_at] <> null and [done] = null and [cancelled] = null then "Ongoing"
else if [done] <> null then "Completed"
else if [cancelled] <> null then "Cancelled" else "N/A")

HotChilli
Super User
Super User

small "if".

I haven't looked at the logic but fix that first.

Screenshot_23.png

Thanks! A bit better 😁 Now getting the error on NULL. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors