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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Microsoft Employee
Microsoft 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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors