Forum Discussion

ejzimmerman's avatar
ejzimmerman
Regular Visitor
5 years ago
Solved

Year over Year Cost Calculation

Hi,   For my report, I am trying to report out on the year over year cost increase, and my source data is in a similar format to the data shown in the table below. I am trying to create a measure t...
  • VahidDM's avatar
    5 years ago

    Hi ejzimmerman 

     

    Try these measures :

    Prior Year = 
    VAR _LY =
        CALCULATE (
            SUM ( 'Table'[Cost] ),
            ALLEXCEPT ( 'Table', 'Table'[Supplier] ),
            PREVIOUSYEAR ( 'Table'[Date] )
        )
    RETURN
        IF ( ISBLANK ( _LY ), 0, _LY )
    Cost Trend = 
    SUM ( 'Table'[Cost] ) - [Prior Year]

     

    Output:

     

    Download the sample file: https://gofile.io/d/EtW8Ls

     

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

    Appreciate your Kudos 🙏!!