I have two tables, one has a column gross profit and the other has total sales and category. I want to divide gross profit by total sales where category = SGA.
How do I get there?
I have two tables, one has a column gross profit and the other has total sales and category. I want to divide gross profit by total sales where category = SGA.
How do I get there?
Create measure:
Gross Margin =
CALCULATE (
DIVIDE ( SUM ( Table1[Gross Profit] ), SUM ( Table2[Total Sales] ) ),
Table2[Category] = "SGA"
)
Note: it will only work if you slice it by shared dimensions. If you run into issues, post your data model snapshot - DAX formulas are highly dependent on the model relations.