Forum Discussion
miguel_tc_27
3 years agoRegular Visitor
Sales Growth
Hello, I have a problem related to sales growth calculations. I want to calculate the sales growth and I have ['Competition'][Costco ($)] with the revenues and ['Competition'][Year] with only the ye...
devanshi
Helper V
3 years agosalesgrowth =
VAR pervoiusyears=CALCULATE(SUM(['Competition'][Costco ($)] ),SAMEPERIODLASTYEAR(['Competition'][Year]))
RETURN
DIVIDE((['Competition'][Costco ($)] )-perviousyear,perviousyear)
miguel_tc_27
3 years agoRegular Visitor
But the thing is Year is not of date type, it is an integer such as 2014. Thus SAMPERIODLASTYEAR does not work correctly.
- devanshi3 years ago
Helper V
try this formula:
salesgrowth =
VAR pervoiusyears=CALCULATE(SUM(['Competition'][Costco ($)] ),DATESYTD(['Competition'][Year]))
RETURN
DIVIDE((['Competition'][Costco ($)] )-perviousyear,perviousyear)
- miguel_tc_273 years agoRegular Visitor
Has the same problem as before.
- devanshi3 years ago
Helper V
salesgrowth =
VAR pervoiusyears=CALCULATE(SUM(['Competition'][Costco ($)] ),['Competition'][Year]=(EARLIER(['Competition'][Year])-1))
RETURN
DIVIDE((['Competition'][Costco ($)] )-perviousyear,perviousyear)