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
Ashmita
New Member

About Power BI if else Dax

My simple if else condition isnt working, i have spent a day in this,Please help.

My calculated column is if a column named asset status is = on hold and another column named days to readiness is greater than 179, the value should be true else false.

the formula i am trying to use

=if(AND([Asset Status] = "on hold",[days to readiness]>179),"true","false"))

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @Ashmita ,

 

I tried to create a pbix file to reproduce your problem, but it worked.

vstephenmsft_0-1657014632106.png

You may download my attachment for reference.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HotChilli
Super User
Super User

It looks reasonably OK.  Are you getting error messages or is the logic not working?  If it is the logic then break the IF statement up and test a simple condition first, for example, test the string comparison by itself (there might be spaces in text field that cause no match to be found)

--

I think it's considered good practice to fully qualify the column names (like table[column name] ) so that they can be distinguished from measures.

--

Let me know how you get on

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.