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
giroldoale
Helper I
Helper I

Why If Else Doesn't work?

Hi,

I am not able to get rid off this issue.

I have a column containings 0,1,2 and i need to construct another column giving the text "Completed" once the value is 2 and "NotCompleted"otherwise.

Al my formulas give me no value, I cannot find the error, can you help me?

 

The formula is 

Column=IF(Table1[Value]=2,"Complete","NotComplete") whatever would be the Table1[Value]

 
 

See picture attached...NotWork.png

1 ACCEPTED SOLUTION

NEWS..

I've try to simply close and reopen the report and now it's works! 

View solution in original post

7 REPLIES 7
PC2790
Community Champion
Community Champion

Hello @giroldoale ,

 

what is the data type of the column - TetsOPCompIDynamic?

It should work if it is set as whole number.

Hi, It's a "Whole Number"

Is it possible for you to share your pbix file, removing all the sensitive data?

 

NEWS..

I've try to simply close and reopen the report and now it's works! 

Tahreem24
Super User
Super User

@giroldoale  - Can you tell me what is the data type of TestopCompIDDynamic column (Sorry for wrongly typing this column name) ? If it is Text so just update your DAX like below:

Column = IF(Table[TestopCompIDDynamic] = "2","Completed","Not Completed")

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Hi, It's a "Whole Number"

Vera_33
Resident Rockstar
Resident Rockstar

Hi @giroldoale 

 

Can you provide some sample data in a format we can copy (not a picture)? What is your current code, M code?

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.