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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Expression.Error: The name 'SWITCH' wasn't recognized. Make sure it's spelled correctly.

Hello All,

 

I am creating a custom column and I am not getting any syntax errors but when I click ok I am getting below error.

Could any one please help how to fix this

 

 

Sathvik123_0-1669432377280.png

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Switch is a DAX function not an M function?  Write it as a calculated column formula

=if(and([Region="APAC",OR([AgentDepartment]="Hyd",[AgentDepartment]="Unknown")),"ASD Hyd",blank())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Switch is a DAX function not an M function?  Write it as a calculated column formula

=if(and([Region="APAC",OR([AgentDepartment]="Hyd",[AgentDepartment]="Unknown")),"ASD Hyd",blank())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur ,

 

I am getting below error.

 

Sathvik123_0-1669433480445.png

 

Write a calculated column formula in DAX not a Custom formula in M


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur ,

 

Could you please help how to do dax for this.

Here my region is a table created in power bi

Already shared that.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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