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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.