Forum Discussion
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.
@jkesavan , replace / with comma,
Check the formula I shared. I'm going through the data.
Check if the attachment can help
3 Replies
- amitchandak
Super User
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]))
- jkesavanFrequent Visitor
The relevant columns are GM $ and Total Cost. I have attached data in excel.
Job Sub C/H Div Client Total Cost GM $ 123 1 C abc 231 4342 123 1 C abc 86.5 249.5 123 1 C abc 51.82 -14.82 123 2 C abc 58.04 22.26 123 3 C abc 83.85 18.35 123 4 C abc 141.28 199.72 123 1 C abc 218.23 382.73 - amitchandak
Super User
@jkesavan , replace / with comma,
Check the formula I shared. I'm going through the data.
Check if the attachment can help