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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
waqarahmadkp
New Member

group/categorization

hi all. i have a column1 having approx 5000000 rows with 29 distinct text values in it. i want to group these 29 distinct under 5 categories/groups in a new column. e.g.

values like oranges, mangoes, cherry is represented as fruits in new column.

values like car, bicycle, bus is represented as vehicle in new column.

 

how i can achieve this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @waqarahmadkp ,

You can update the formula of your calculated column as below:

Column = 
SWITCH (
    TRUE (),
    [ApplicationType] IN { "Duplicate", "Duplicate (R)" }, "Dup",
    "other"
)

yingyinr_0-1656572930298.png

Best Regards

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@waqarahmadkp , You need to create a new column using switch

 

Switch( True() ,

[column] in {"1", "2", "3"} , "Cat1",

[column] in {"3", "4", "5"} , "Cat2",

"Cat3"

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

based on your suggestion, i am adding a new column as follows

=Switch(True() ,
[ApplicationType] {"Duplicate", "Duplicate (R)"} "Dup",
"other"
)

however it is giving error Token RightBrace Expected.

also can there be any other drag and drop option to do so.

Anonymous
Not applicable

Hi @waqarahmadkp ,

You can update the formula of your calculated column as below:

Column = 
SWITCH (
    TRUE (),
    [ApplicationType] IN { "Duplicate", "Duplicate (R)" }, "Dup",
    "other"
)

yingyinr_0-1656572930298.png

Best Regards

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.

Top Solution Authors