Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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? 🙂
Solved! Go to Solution.
Hi @Anonymous ,
Try creating calculated columns like this:
Stock Y/N = IF('Table (2)'[Stock]<>"No"&&NOT(ISBLANK('Table (2)'[Stock])),"Yes","No")
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.
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"
)
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
Hi @Anonymous ,
Try creating calculated columns like this:
Stock Y/N = IF('Table (2)'[Stock]<>"No"&&NOT(ISBLANK('Table (2)'[Stock])),"Yes","No")
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@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 &&