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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.