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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Nestet if else

Hello to everybody, I don't get it. I don't know why. Maybe to long working days. 

 

It is a easy problem but I am lost. I would like to check the results for the column "Bedarfsmenge" to column "Bedarfsmenge.4". 

If column Bedarfsmenge is null then take value of Bedarsfmenge.1, if this column is empty take Bedarfsmenge.2 and so on. 

 

This is my code:

 

"Benutzerdefiniert", each if [Bedarfsmenge] = null then [Bedarfsmenge.1] else if [Bedarfsmenge.1] = null then [Bedarfsmenge.2] else if [Bedarfsmenge.2] = null then [Bedarfsmenge.3] else if [Bedarfsmenge.3] = null then [Bedarfsmenge.4] else [Bedarfsmenge])

 

But result is not as wished the value of column "Bedarsmenge.2". It is null. What is wrong? 

Carl1985_0-1688554600426.png

 

5 REPLIES 5
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,
As I look at your picture, the data type has not been selected in the columns.
First I would fix that.
Next if the value = "null" use that in your formula.  If the value = 0 then use that in your formula.

Finally it is easier to write a SWITCH(TRUE()).
So it might look like this:
SWITCH(TRUE(),
Column1<>0,
Column2<>0,
Column3<>0
)
This formula uses whichever value is true that it comes to first.  So, if Column1 <> 0 is true, it will use that value and if not it will continue checking subsequent values.

Hope this helps.

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




AlienSx
Super User
Super User

null.jpg

Anonymous
Not applicable

Hello Alien, I didn't get it. I'm lost with this information, sorry for that. What I have to change in my formula?

@Anonymous , the code in your message <> code in your picture. Replace zeros (0) with null in the formula in PQ (your picture) and see how it works. You are expecting that null is equal to 0. It doesn't.  

Anonymous
Not applicable

Ok, now I got it. Sorry for that missunterstanding with the picture and the code. 

 

I took a wrong screenshot. I tried "null" as well as 0. With no success. 

 

Lost. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.