Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculate increase every year

Hello Community,

 

I need to calculate the increase in growth with comparison to the previous year in the graph.

Thanks in advance

 

 

  • Hi, Anonymous 

     

    You can try the following methods.

    1. Create a calculation column to calculate the time of the previous year.

     

    Last year = 
    DATEADD ( 'Table'[Year], -1, YEAR )
    

     

     

       2.  Calculate the growth rate of the current year over the previous year.

     

    Growth Supply = 
    CALCULATE (
        SUM ( 'Table'[Supply] ),
        FILTER ( 'Table', 'Table'[Year] = EARLIER ( 'Table'[Year] ) )
    )
        - CALCULATE (
            SUM ( 'Table'[Supply] ),
            FILTER ( 'Table', 'Table'[Year] = EARLIER ( 'Table'[Last year] ) )
    )
    
    Growth Demand =
    CALCULATE (
        SUM ( 'Table'[Demand] ),
        FILTER ( 'Table', 'Table'[Year] = EARLIER ( 'Table'[Year] ) )
    )
        - CALCULATE (
            SUM ( 'Table'[Demand] ),
            FILTER ( 'Table', 'Table'[Year] = EARLIER ( 'Table'[Last year] ) )
        )
    

     

     

       3. Show results in graph.

    If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous 
    Make sure you have a calendar table, 


    Growth vs PY =
    VAR __currentyear =
        SUM ( tablename[demand] )
    VAR __previousyear =
        CALCULATE ( SUM ( tablename[demand] ), DATEADD ( dates[Date], -1, YEAR ) )
    VAR __growth = __currentyear - __previousyear
    RETURN
        __growth
  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, Anonymous 

     

    You can try the following methods.

    1. Create a calculation column to calculate the time of the previous year.

     

    Last year = 
    DATEADD ( 'Table'[Year], -1, YEAR )
    

     

     

       2.  Calculate the growth rate of the current year over the previous year.

     

    Growth Supply = 
    CALCULATE (
        SUM ( 'Table'[Supply] ),
        FILTER ( 'Table', 'Table'[Year] = EARLIER ( 'Table'[Year] ) )
    )
        - CALCULATE (
            SUM ( 'Table'[Supply] ),
            FILTER ( 'Table', 'Table'[Year] = EARLIER ( 'Table'[Last year] ) )
    )
    
    Growth Demand =
    CALCULATE (
        SUM ( 'Table'[Demand] ),
        FILTER ( 'Table', 'Table'[Year] = EARLIER ( 'Table'[Year] ) )
    )
        - CALCULATE (
            SUM ( 'Table'[Demand] ),
            FILTER ( 'Table', 'Table'[Year] = EARLIER ( 'Table'[Last year] ) )
        )
    

     

     

       3. Show results in graph.

    If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.