Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Divide by Zero error

Hi All,

 

I have this measure that's causing error due to divide by zero error.  How can I get pass this?

% Change =  SUMX(Summary, Summary[CQ] - Summary[PYQ]/(Summary[PYQ]))
Thanks
Ejyks
  • Anonymous's avatar
    Anonymous
    7 years ago

    Think this should work:

    % Change =
    SUMX (
        Summary,
        DIVIDE( 
        	(Summary[CQ] - Summary[PYQ] ),  //Numerator
            Summary[PYQ] ,                  //Denominator
            "If Error, put something here!" //Alternate Result
    	)
    )

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    use the DIVIDE function instead of /.  It has an input as for what to do if there is an error. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Could you help me apply the divide function into the formular above as I'm getting error applying it.

      Thanks.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Think this should work:

        % Change =
        SUMX (
            Summary,
            DIVIDE( 
            	(Summary[CQ] - Summary[PYQ] ),  //Numerator
                Summary[PYQ] ,                  //Denominator
                "If Error, put something here!" //Alternate Result
        	)
        )