Forum Discussion

Euro0681's avatar
Euro0681
Helper II
3 years ago
Solved

Dividing 2 columns

I am trying to simply divide 2 columns but when doing so i get a wrong value (Example Below)

The correct value I'm looking for is "1.xxxx" , Note Column1 is displaying the sum and same concept for Column2 (they are displaying the sum for the entire column)


 

  • Hi Euro0681 

    create a Measure 

    DIVIDE ( SUM ( 'Table'[Column1] ), SUM ( 'Table'[Column2] ) )

6 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi Euro0681 

    create a Measure 

    DIVIDE ( SUM ( 'Table'[Column1] ), SUM ( 'Table'[Column2] ) )

    • Euro0681's avatar
      Euro0681
      Helper II

      tamerj1 what if i need the value to be static and not change whenever extra fields are added, in other words is there a way to do this using a column as opposed to a measure?

      • tamerj1's avatar
        tamerj1
        Community Champion

        Euro0681 

        CALCULATE ( DIVIDE ( SUM ( 'Table'[Column1] ), SUM ( 'Table'[Column2] ) ), ALL ( 'Table' ) )

  • tamerj1 We can think of Column1 = quantity and column2 = price or something like that so each category has different quantity and price but the division for each is what i want to be static

     

    • tamerj1's avatar
      tamerj1
      Community Champion

      Euro0681 

      Please try

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