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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Using IF with two different ResultIfFalse responses

Hey there. Newbie here. I have a column named Stock that contains a variety of values. I've created a new column that I would like to return a No or Yes value based on the below. 

 

What am I doing wrong? 🙂 

 

Stock Y/N = IF('Table'[Stock] = "No", "No", "Yes" OR "Some" OR "Not Many")
 
Stated differently, I'd like a "Yes" return on any value that is not "No" and not empty.
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try creating calculated columns like this:

Stock Y/N = IF('Table (2)'[Stock]<>"No"&&NOT(ISBLANK('Table (2)'[Stock])),"Yes","No")

test_Stock.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Is this problem sloved?
If not, please let me know.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

check this out.

https://docs.microsoft.com/en-us/dax/switch-function-dax

 

Stock Y/N = 
SWITCH(
      'Table'[Stock],
	  BLANK(), BLANK(),
	  "No"   , "No"   ,
	  "Yes"
      )

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try creating calculated columns like this:

Stock Y/N = IF('Table (2)'[Stock]<>"No"&&NOT(ISBLANK('Table (2)'[Stock])),"Yes","No")

test_Stock.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , In a new column this should have worked

Stock Y/N = IF('Table'[Stock] = "No", "No", "Yes")

Means when value is no then return No else return yes

Or

Stock Y/N = IF('Table'[Stock] in{ "Yes" , "Some" , "Not Many"} , "Yes","NO")

Or

Stock Y/N = IF('Table'[Stock] = "Yes" || 'Table'[Stock] = "Some" || 'Table'[Stock] = "Not Many"} , "Yes","NO")

 

For And you can use &&

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors