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! Learn more

Reply
Anonymous
Not applicable

Using the SWITCH Command with brackets in the name doesn't work

Hello, I am using the SWITCH command to normalize some company names. For example:

Normalized = SWITCH([Company],
"International Business Machines", "IBM",
"Microsoft", "MSFT"

 

 All is working well however, when I there is a bracket in the name it doesn't see it. For example:

Normalized = SWITCH([Company],
"Laboratory Corp. of America (Labcorp)", "LH")

In the filter cards it’s listed is a "Blank" 

There is no error on the DAX command. Any suggestions?

The data source cannot be changed so I am left with the brackets.

4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @Anonymous  ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution to help others find it.
 

Best Regard

Lucien Wang

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

I tried the dax you provided and it works.See the below:

v-luwang-msft_0-1614332683316.png

 

Check that the contents of the table match exactly what is used in Dax. And could pls provide your pbix file ? Remember to remove the confidential information.

 

Wish  it is helpful for you!

 

Best Regard

Lucien Wang

 

amitchandak
Super User
Super User

@Anonymous , It should work , check for spaces

 

or try one of the two

 

Normalized = SWITCH([Company],
"Laboratory Corp. of America "(Labcorp")", "LH")

 

or

 

Normalized = SWITCH([Company],
"Laboratory Corp. of America \(Labcorp\)", "LH")

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
Anonymous
Not applicable

Thanks for the quick reply. Okay this is strange, neither work, however:

 

Laboratory Corp. of America "(Labcorp")", "LH") - this errors out the DAX

ERROR: The syntax for '(' is incorrect.

 

Using the backslash doesn't give me an error, but also doesn't change it and it still remains Blank in the filter cards. 

 

However, I don't know if I copied something wrorg or PBI added it but when I add "LH" front the backslash works. For example this works:

 "LH","Laboratory Corp. of America \(Labcorp\)", "LH")

Strange- but thank you!!

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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