Forum Discussion

miguel_tc_27's avatar
miguel_tc_27
Regular Visitor
3 years ago

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 year (2014 for example). I need a metric providing me with the growth in percentage of these revenues (for instance (revenues in 2015-revenues in 2014)/revenues in 2014).

Thanks!

6 Replies

  • salesgrowth =

    VAR pervoiusyears=CALCULATE(SUM(['Competition'][Costco ($)] ),SAMEPERIODLASTYEAR(['Competition'][Year]))

    RETURN

       DIVIDE((['Competition'][Costco ($)] )-perviousyear,perviousyear)

    • miguel_tc_27's avatar
      miguel_tc_27
      Regular Visitor
      But the thing is Year is not of date type, it is an integer such as 2014. Thus SAMPERIODLASTYEAR does not work correctly.
      • devanshi's avatar
        devanshi
        Icon for Helper V rankHelper V

        try this formula:

        salesgrowth =

        VAR pervoiusyears=CALCULATE(SUM(['Competition'][Costco ($)] ),DATESYTD(['Competition'][Year]))

        RETURN

           DIVIDE((['Competition'][Costco ($)] )-perviousyear,perviousyear)