Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Division: No numerator

Hello,

 

I would like to write a measure, which would divide Column1 by Column2, and provide 0 when there is no numerator, i.e. value in Column1. Whereas, currently I get a blank.

 

  • Hi Anonymous 
    You can try

    Measure1 =
    SUMX ( 'Table', COALESCE ( DIVIDE ( 'Table'[Column1], 'Table'[Column2] ), 0 ) )

2 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi Anonymous 
    You can try

    Measure1 =
    SUMX ( 'Table', COALESCE ( DIVIDE ( 'Table'[Column1], 'Table'[Column2] ), 0 ) )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you, tamerj1 !  It works well.