0
votes

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?

1
What are the relationships between the tables?RADO
The dates of both tables are joined to a calendar dimension.theLuckyOne

1 Answers

1
votes

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.