Forum Discussion
aditidhooria
9 years agoFrequent Visitor
Comparing columns in two different tables
I have a table named Sales Transaction in which I have two fields : Revenue Amount and Cost Amount. I need to calculate Gross Margin (GM) which is the difference of Revenue Amount and Cost Amount using DAX expression.
Can someone help please ?
Firstly, make sure you write a measure and not a column. Read about that here http://exceleratorbi.com.au/calculated-columns-vs-measures-dax/
A measure something like this should do it.
GM = sumx(Sales,Sales[Revenue] -Sales[Cost])
2 Replies
- MattAllingtonCommunity Champion
Firstly, make sure you write a measure and not a column. Read about that here http://exceleratorbi.com.au/calculated-columns-vs-measures-dax/
A measure something like this should do it.
GM = sumx(Sales,Sales[Revenue] -Sales[Cost])
- aditidhooriaFrequent VisitorThanks Matt for the quick response. I am trying the same.