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
Pricey79
Helper V
Helper V

Help with SWITCH function please

Hello, I was hoping someone could help me please.

I'm really struggling with something

 

I have a column in a table called Product. This has aorund 15 unique items in it.

I would like another column with a more generic Product description. So for example, if the product column had the choices BMX, Mountain or Racer, I would like a new column to say Bike, if the column product = BMX, Mountain or Racer

 

Could anybody please help with that, I'm really struggling.

 

Thank you in advance for any help.

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Pricey79,

 

Try this calculated column:

 

Product Group = 
VAR vProduct = Table1[Product]
VAR vResult =
    SWITCH ( TRUE (), vProduct IN { "BMX", "Mountain", "Racer" }, "Bike", "Other" )
RETURN
    vResult

 

DataInsights_0-1626354521452.png

 





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

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@Pricey79,

 

Try this calculated column:

 

Product Group = 
VAR vProduct = Table1[Product]
VAR vResult =
    SWITCH ( TRUE (), vProduct IN { "BMX", "Mountain", "Racer" }, "Bike", "Other" )
RETURN
    vResult

 

DataInsights_0-1626354521452.png

 





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

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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