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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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