Forum Discussion

jkesavan's avatar
jkesavan
Frequent Visitor
5 years ago
Solved

How to divide two columns from dashboard table

Hi all, 

 

i am struggling to divide two values from a table i have sorted and created using a matrix table. Its pretty easy to do it in Excel but i can't really understand how to make it work in PowerBI. 

 

For example i would like to do GM$ divide by Total Cost. However the table i have generated is a sum total of the values in EMP. If i manually add a extra column to do this , it does this for every single value instead of the the total sum i want from the table. Hopefully this makes sense.

 

 

GM% = ('Raw Data'[GM $]/'Raw Data'[Total Cost]) Syntax used to generate this. Although its clearly not correct. 

 

How i did it in excel to produce the correct results. 

 

 

3 Replies

  • jkesavan , It should be like this, but Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

     

    GM% = divide(sum('Raw Data'[GM $]),sum('Raw Data'[Total Cost]))

    • jkesavan's avatar
      jkesavan
      Frequent Visitor

      The relevant columns are GM $ and Total Cost. I have attached data in excel. 

      JobSubC/HDivClientTotal CostGM $
      1231C abc2314342
      1231C abc86.5249.5
      1231C abc51.82-14.82
      1232C abc58.0422.26
      1233C abc83.8518.35
      1234C abc141.28199.72
      1231C abc218.23382.73