Forum Discussion
wwii
9 years agoFrequent Visitor
Calculate Marginal Ratio in PowerBI
Hi, I wonder is there any quick way to calculate a marginal profit ratio, i.e. (x-y)/x in PowerBi? Thank you and I appreciate.
wwii
9 years agoFrequent Visitor
I used this formula,
YoY% = var Sales = SUM(SalesTable[Amount])
var SalesLastYear=CALCULATE(Sales, SAMEPERIODLASTYEAR(Calenda[Date]))
return if(Sales, DIVIDE(Sales - SalesLastYear, Sales))
But the outcome is all 0.
Is there is a way to know why?
Thanks
BhaveshPatel
Super User
9 years agoWhat do you meany by this:
if(Sales, DIVIDE(Sales - SalesLastYear, Sales))
Why do you need to use measure in the first argument.