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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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