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
TDERUSSO
Frequent Visitor

How to create a new category based on a column?

I am try to create a new category column based on another column in my data model.  Below is an example of what I am try to accomplish.  Please let me know.

 

Column Data: Shirts, Sweaters, Jeans, Shorts --> New Category: Clothes

Column Data: Sneakers, Boots, Sandals, Slippers --> New Category: Shoes

 

Thanks,

Tony

1 ACCEPTED SOLUTION
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @TDERUSSO

 

Here is a quick and easy approach in DAX.  Just add a calculated column to your table (replace Table2[Column1] with your details.

 

Category Column = SWITCH(
                TRUE(), 
                Table2[Column1] In {"Shirts","Sweaters","Jeans","Shorts"},"Clothes",
                Table2[Column1] In {"Sneakers","Boots","Sandals","Slippers"},"Shoes",
                "Other"
                ) 

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

6 REPLIES 6
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @TDERUSSO

 

Here is a quick and easy approach in DAX.  Just add a calculated column to your table (replace Table2[Column1] with your details.

 

Category Column = SWITCH(
                TRUE(), 
                Table2[Column1] In {"Shirts","Sweaters","Jeans","Shorts"},"Clothes",
                Table2[Column1] In {"Sneakers","Boots","Sandals","Slippers"},"Shoes",
                "Other"
                ) 

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

That worked, thanks for your help!

Thanks, I will give this a try!

Another option is to create a Group.

 

From the Fields menu, click the elipsis next to the column you'd like to create groups for and click the "New Group" option at the bottom to bring up a window where you can build custom groups.

 

Edit Groups.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

goaltender36
Helper I
Helper I

Hey @TDERUSSO

 

Have you thought about creating a sperate table that had the categories and then connecting them with a 1:many relationship?

Hi goaltender36, No, I'm new to Power BI.  Is that the best approach to handle this?

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