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
koningroel
Frequent Visitor

If statement with 3 variables puts just 2 out

Hi community,

 

I have a data set with a collumn with the next 3 values: 

True

False

null (blank)

 

Now I want to make a 100% stacked chart, with the ability to drill to the records (Data/drill  -> show records on)

So I thought I'd make a calculated collumn using the next formula:

 

Bankkoppeling mogelijk 2 = IF(SQL_DB[Bankkoppeling mogelijk]=FALSE(),"Niet mogelijk",IF(SQL_DB[Bankkoppeling mogelijk]=BLANK(),"Niet gevuld","Mogelijk"))

 

With 'Bankkoppeling mogelijk' being the mentioned collumn. 

My results are not as I expect, however I build my IF statement, I never get the last option (in this case "Mogelijk").

My calculated collumn only has the values: "Niet mogelijk" and "Niet gevuld". 

I've tried this statement mixing the values, but it never shows the last result in the 2nd IF statement. 

I'm not an advanced (DAX) programmer, I come from Excel and have limited experience in Power BI. 

Any help will be more than welcome.

1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

There doesn't seem much wrong with your formula, maybe try putting the entirety of your second IF statement in a bracket. Failing that, rather than using an IF statement, why not try using SWITCH to change the values instead?

View solution in original post

2 REPLIES 2
v-ljerr-msft
Employee
Employee

Hi @koningroel,

 

Have you tried the solution provided by @jthomson above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?

 

If you still have any question on this issue, feel free to post here. Smiley Happy

 

Regards

jthomson
Solution Sage
Solution Sage

There doesn't seem much wrong with your formula, maybe try putting the entirety of your second IF statement in a bracket. Failing that, rather than using an IF statement, why not try using SWITCH to change the values instead?

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.