Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
alexpegg86
Helper I
Helper I

PARALLELPERIOD not working as I want it to

hi all,

 

I'm trying to use PARALLELPERIOD to return sales data for the same period last year. For some reason, it shows the annual total, but i want to see it by month. See below the screenshot of the measure:

alexpegg86_1-1720520624454.png

 

 

Any ideas on why this may be?

 

Thanks.

 

1 ACCEPTED SOLUTION

@alexpegg86 

You can use both:

Value Previous Year=
CALCULATE(
    SUM('Total Soft Drinks Output'[Spend]),
PREVIOUSYEAR(DateTable[Period End Date])
)
 
or
 
Value Previous Year=
CALCULATE(
    SUM('Total Soft Drinks Output'[Spend]),
PARALLELPERIOD(DateTable[Period End Date], -1, YEAR)
)
 
Please, accept my answer as a solution.
 
BBF

View solution in original post

5 REPLIES 5
BeaBF
Super User
Super User

@alexpegg86 Hi! Can you paste sample data and the measure? or share the pbix file

 

BBF

Hi @BeaBF ,

 

I've saved them to google drive - hopefully the links work for you:

Power BI file: https://drive.google.com/file/d/1OJ82btg26MRy_cvH3BWhuOQ5eN0ZA705/view?usp=drive_link

 

csv data source: https://drive.google.com/file/d/1CiuDqnm0so5Tsc2nNPzSt28RozerhU3u/view?usp=drive_link

 

 

@alexpegg86 I'va found the solution.

You need a Calendar Table, i've created one in this way:

DateTable = DISTINCT('Total Soft Drinks Output'[Period End Date])
 
Then, you have to create a relationship between this new table and the Total Soft Drinks Output (one to many), in this way:
BeaBF_0-1720532117796.png

 

At least, adapt your measure as:

Value Previous Month =
CALCULATE(
    SUM('Total Soft Drinks Output'[Spend]),
    PARALLELPERIOD('DateTable'[Period End Date], -1, MONTH)
)
or also:
Value Previous Month =
CALCULATE(
    SUM('Total Soft Drinks Output'[Spend]),
PREVIOUSMONTH(DateTable[Period End Date])
)
you need to use date of the new DateTable in the Visual, so you need to calculate Period, Year, on the new DateTable. It will work fine:
BeaBF_1-1720532514513.png

 

if you send me your mail on pvt message i can send you the pbix arranged.

 

if it's ok, please accept as solution.

 

BBF




Thanks @BeaBF .

 

I actually want the value to be the value for the same period last year... so June 2024 would show June 2023... would i just change the measure to:

 

CALCULATE(
    SUM('Total Soft Drinks Output'[Spend]),
    PARALLELPERIOD('DateTable'[Period End Date], -12, MONTH)
)
 
 
?

@alexpegg86 

You can use both:

Value Previous Year=
CALCULATE(
    SUM('Total Soft Drinks Output'[Spend]),
PREVIOUSYEAR(DateTable[Period End Date])
)
 
or
 
Value Previous Year=
CALCULATE(
    SUM('Total Soft Drinks Output'[Spend]),
PARALLELPERIOD(DateTable[Period End Date], -1, YEAR)
)
 
Please, accept my answer as a solution.
 
BBF

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.