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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Rsnor
Regular Visitor

Help with if and statement

Apologies if this was answered before.

I am having issues with my if and statements in power query. 

 

=If [item1] = 1 and [item2] <> null then 1 else 0

 

Where [item2] just needs to have any text in the cells and [item1] has only either 1 or 0. 

 

The query keeps on returning 0 even if all conditions are met. I feel "<> null" is where the issue is but im not sure,kinda new to this.

 

 

1 ACCEPTED SOLUTION

=If [item1] = 1 and Text.Combine({[item2],[item3],[item4]})<>"" then 1 else 0

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

=If [item1] = 1 and not List.Contains({null,""},Text.Trim([item2])) then 1 else 0

Hi, thank you very much for this but its still returning 0 as a result. I think I screwed up explaining what I was trying to do. Basically I'm trying to put the fx below to my query. 

 

 

 

=IF(AND(D3=1,LEN(E3)>0,LEN(F3)>0,LEN(G3)>0),1,0)

fx.png

 

=If [item1] = 1 and Text.Combine({[item2],[item3],[item4]})<>"" then 1 else 0

That's it! thank you so much daniel.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.