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

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.

Reply
Moh_ali_square
Advocate I
Advocate I

MDX error message : Expression error: The name 'DIVIDE' wasn't recognized. Make sure it's spelled c

Hi, 

 

I'm trying to use divide function, but I got error message

 

Expression error: The name 'DIVIDE' wasn't recognized.  Make sure it's spelled correctly.

 

my experssion :

= divide ([Unrestricted Stock],[Unrestricted Stock Value],0)

as I'm looking to divide two columns, the denominator some times is zero, so I want the equation to return zero.

 

Thanks.

1 ACCEPTED SOLUTION

Hi @Moh_ali_square,

 

>>even the syntex checker is marking green. 

Power query not support these functions, actually the syntax check only check the formula name and parameters type.

 

In power query. you can direct use "/" to calculate with divide; for if statement you should use it like below formula:

if expression then value_if_true else value_if_false

 

Reference:

Insert a custom column into a table (Power Query)

Power Query - Overview and Learning

 

BTW, I'd like to suggest you use the dax formula(report view), it support these functions which you mentioned.

 

Regards,

Xiaxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Moh_ali_square,

 

Which type of query you use? Power query or dax query? Can you share some detail content of your issue? (e.g. table structs)

 

BTW, there is not divide function in power query.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft

 

I am using Power Query.

the error comes for many functions, like divide, IIF, IF. 

even the syntex checker is marking green. 

 

Hi @Moh_ali_square,

 

>>even the syntex checker is marking green. 

Power query not support these functions, actually the syntax check only check the formula name and parameters type.

 

In power query. you can direct use "/" to calculate with divide; for if statement you should use it like below formula:

if expression then value_if_true else value_if_false

 

Reference:

Insert a custom column into a table (Power Query)

Power Query - Overview and Learning

 

BTW, I'd like to suggest you use the dax formula(report view), it support these functions which you mentioned.

 

Regards,

Xiaxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors