Forum Discussion
Difference between two measures
- Anonymous9 years ago
The important realization (I think...?) is that measures can references other measures.
Sales := SUM(Transactions[SaleAmt])
SalesPY := CALCULATE([Sales], SAMEPERIODLASTYEAR(Dates[Date])
Sales Delta := [Sales] - [SalesPY]
So, the general answer to "how do I take the difference between 2 measures" is... well, just subtract them :)
The important realization (I think...?) is that measures can references other measures.
Sales := SUM(Transactions[SaleAmt])
SalesPY := CALCULATE([Sales], SAMEPERIODLASTYEAR(Dates[Date])
Sales Delta := [Sales] - [SalesPY]
So, the general answer to "how do I take the difference between 2 measures" is... well, just subtract them :)
AnonymousCan you offer any pointers on how to solve for the below scenario? I have a clustered column chart where I'm pulling in Revenue, and slicers created by What If parameters for changes in price and demand. I want to calculate the impact on revenue after changes in price and demand, which I can do if the changes in price and demand are both positive. But if the change in either price or demand are negative, adding the difference between price and demand won't work (see second table). I'm not looking for anyone to solve this for me but I would love to hear opinions on which DAX functions to use to handle the measure I'm creating when there are negative values in either price or demand.
| Revenue | 5 |
| Change in Price | 5 |
| Change in Demand | 11 |
| Sum of changes in price and demand relative to revenue | 6 |
| Revenue plus Changes in Price and Demand | 11 |
| Revenue | 5 |
| Change in Price | -5 |
| Change in Demand | 11 |
| Sum of changes in price and demand relative to revenue | 16 |
| Revenue plus Changes in Price and Demand | 21 |