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! Request now

Reply
Anonymous
Not applicable

question on DAX

Hi BPI users, 

 

I have a question on Dax, I have column contains 7 product names and I want to create a Y/N column where Y = all the 7 product names and N = include  all except one product name . Is there a switch function we can use in DAX to do that 

5 REPLIES 5
ryan_mayu
Super User
Super User

@Anonymous 

Do you want to use this in the filter or calculation?

could you pls provide the sample data and expected output?





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

Proud to be a Super User!




Anonymous
Not applicable

I want to use that in a filter 

the total products I have is 

MaliniB_0-1664550517013.png

My expected output for Y is all the 7 products together and N should have all the 6 products except the one which is left out.

@Anonymous 

pls see the attachment to check if this is what you want





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

Proud to be a Super User!




Anonymous
Not applicable

Hi Greg, 

 

The formula you suggested gives me Y= all 7 product and N= only one product.  but I want for N = all product 6 except one. This is where I am stuck 

Greg_Deckler
Community Champion
Community Champion

@Anonymous Sure:

Column = 
  SWITCH([Product],
    "Product No","N",
    "Y"
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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