Power BI

PARALLELPERIOD() in Power BI

PARALLELPERIOD() in Power BI

Table of Contents

Introduction

The time intelligence functions in Power BI offer effective tools that help in assessing performance and recognizing trends across several time intervals. One such powerful function is PARALLELPERIOD(), which allows you to retrieve data from a parallel time frame, such as the same period last year. This is especially useful for year-over-year (YoY) analysis, helping businesses evaluate growth and performance effectively.

Learn how to use the PARALLELPERIOD() function to compare sales with the previous year and understand how it differs from DATEADD().

To get a better understanding about other important aspects of Power BI, you can also use the following sources:

Using PARALLELPERIOD()

PARALLELPERIOD() is used to generate a table of dates over which further calculations are performed.

DAX Formula for PARALLELPERIOD()
Figure 1: DAX Formula for PARALLELPERIOD()

You can access the Power BI sample by downloading the files directly from the link provided below.

Use PARALLELPERIOD() to compare current Sales with Sales from the same period last year:

  1. Right click on All Measures in the Fields.
  2. Click on New measure.

Measure tools open.

  1. Type the following formula in the formula bar and press Enter.

DAX

Sales PPLY (CM) =

CALCULATE (

    [Total Sales Amount (CM)],

    PARALLELPERIOD ( ‘Date'[Date], -1, YEAR )

)

In the above expression:

  • A virtual date table is calculated using the same period from one year earlier.
  • The total sales amount for the dates in the rows of the virtual table is calculated.

4. Click on the “$” in the formatting section.

5. Type “2” in the text box.

6. Click on the matrix visual in the visualization pane.

7. Drag and drop Year column from the Date table to the rows.

Notice that an automatic date hierarchy is created.

8. Drag and drop Total Sales Amount (CM) and Sales PPLY (CM) from the All Measures table to the Values.

Total Sales Amount for 2017
Figure 2: Total Sales Amount for 2017 is reflected in Sales PPLY (CM) for 2018.

Let’s use this value for sales comparison.

9. Right click on All Measures in the Fields.

10. Click on New measure.

Measure tools open.

11. Type the following formula in the formula bar and press Enter.

DAX

% Sales compared to last year (CM) =

DIVIDE ( [Sales Amount YTD using TOTALYTD (CM)], [Sales PPLY (CM)] )

12. Click on the “%” in the formatting section.

13. Drag and drop % Sales compared to last year (CM) from the All Measures table to the Values.

Total Sales Amount
Figure 3: Displaying yearly sales performance from 2017–2020, including Total Sales Amount, Previous Year Sales, and Percentage Sales Compared to Last Year, calculated as current-year sales divided by previous-year sales.

Conclusion

By using time intelligence functions properly, Power BI can provide valuable insights that prove helpful in making decisions. PARALLELPERIOD() is a powerful time intelligence function in Power BI that helps compare data across different time periods. This function enables you to create a parallel period, making it easy to perform comparisons such as calculating sales from the previous year.

FAQs

The PARALLELPERIOD() is the time intelligence function that is available in DAX and it gives a set of dates for a previous or a future period including previous year, quarter or month in Power BI.

It happens because PARALLELPERIOD() cannot work at day level and thus give aggregated results for the whole year resulting in the same values for all months.

Extended Learning & References      

For more in-depth learning and advanced Power BI training, enroll in     

Here, you can access detailed courses and resources designed to enhance your Power BI skills and take your reporting capabilities to the next level.    

Leave a Reply

Your email address will not be published. Required fields are marked *