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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX add column and group other variable as other

I'm currently trying to create a page filter for my "Custom1" column that contains data "COP1" "COP2" and various other names.

 

Rather than have the entire list appear in the dropdown slicer is it possible to create an addcolumn via DAX that gives me values "COP1", "COP2" and "Other"? 

 

i.e. I'm trying to rename all other variables as "Other" in a new column

1 ACCEPTED SOLUTION

@Anonymous ,

 

Custom 1 Sort = IF([Custom_1] = "COP1" || [COLUMN1] = "COP2",[Custom_1], "Other")


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

Custom2 = SWITCH([Custom1],
"COP1" || "COP2",[Custom1],
"Other")


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler An error has appeared :

 

Function 'SWITCH' does not support comparing values of type Text with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values .

 

Custom 1 Sort = SWITCH([Custom_1],
"COP1" || "COP2",[Custom_1],
"Other")

Sorry @NeilL tried to get too fancy:

Custom2 = SWITCH([Custom1],
"COP1",[Custom1],
"COP2",[Custom1],
"Other")


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Anonymous ,

 

Custom 1 Sort = IF([Custom_1] = "COP1" || [COLUMN1] = "COP2",[Custom_1], "Other")


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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