Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Hi @cmajewsk ,
Best Regard
Lucien Wang
Hi @cmajewsk ,
I tried the dax you provided and it works.See the below:
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
@cmajewsk , 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")
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!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |