Calculate Last Year Value in DAX for Power BI

How to calculate the last year value with DAX in Power BI? Simply use the available DAX CALCULATE function combined with the PREVIOUSYEAR function. In financial Dashboard and Reports, use the previous year value for comparison and variance calculation with the current year. Indeed analysing financial figures is often about comparison.

How to calculate the last year value with DAX in Power BI using a formula?

The first option is to use directly the value from an existing column in our source table imported in a Tabular Model or in Power BI.

Sales Last Year := CALCULATE(SUM('ShopSales'[SalesAmount]), PREVIOUSYEAR('Time'[DateKey]))

The second option is to use a previously created measure and use it as a source, like in the second formula example.

Sales Last Year := CALCULATE([Sales], PREVIOUSYEAR('Time'[DateKey]))

DAX abbreviation stands for Data Analysis Expression and it’s a Microsoft language used mainly in Power BI reports and dashboards.

Be the first to comment

Leave a Reply