Forum Discussion
TDERUSSO
9 years agoFrequent 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, ...
- 9 years ago
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" )
Phil_Seamark
Microsoft Employee
9 years agoHi 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"
) TDERUSSO
9 years agoFrequent Visitor
That worked, thanks for your help!