Forum Discussion

Moh_ali_square's avatar
Moh_ali_square
Icon for Advocate II rankAdvocate II
9 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    9 years ago

    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

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

    • Moh_ali_square's avatar
      Moh_ali_square
      Icon for Advocate II rankAdvocate II

      Hi Anonymous

       

      I am using Power Query.

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

      even the syntex checker is marking green. 

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        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