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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Sathvik123
Helper V
Helper V

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/

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/

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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