Skip to main content

Same Period Last Year Function in Power BI

Table of Contents

A crucial part of the financial analysis is to know whether the business is growing or declining, so, how do we know that? By comparing it to the previous year by using Same Period last Year Function.

Problem Statement for Same Period Last Year

Show a linear chart to compare the trend between two years. As shown in the image below.

Same Period Last Year Comparison in Power BI

Let’s learn How to Make Year Wise Comparison Visual in Power BI

Step 2: Go to calculations Selection

Step 3: Click in New Measure (Shown in the Image Below)

New Measure Ribbon

Now let’s Add Favorable Measures to Calculate Net Sales and Previous Year Sales

Firstly, we have to create measures. Two measures have been used here, “Net Sales” and “Net Sales Same Period Last Year”.

Let’s Calculate Net Sales Measure:

				
					Net Sales = CALCULATE(
        [Total Amount],
        FabricData[Category 1] = "Total Sales"
        )
				
			

It will calculate the Net sales where category 1 in fabric data is equal to “Total Sales”

Now let’s calculate the Same period Last Year Measure

				
					Net Sales Same Period LY = CALCULATE(
        [Net Sales],
        SAMEPERIODLASTYEAR(DateTbl[Date])
        )
				
			

Let's Put these Measure in our Visual

Step 1: Select the Line chart Visual from Visualizations Section in power BI

Line Chart Visual

Step 2: Now Select it and you will have a blank visual on the Report View page.

Step 3: Select or drag these measures in the Y-Axis and Month wise date on the X-Axis.

Same Period Last Year Comparison in Power BI

Hurray!! You have learned how to compare between two periods and create measure.

Add comment