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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.