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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Parallelperiod not working as expected

Hello, 

With Covid 19 , I am trying to compare monthly "numbers" with the ones from last year but also from the same period in 2019 ...

 

My table is only 2 columns : date & number1 

I am adding a column number2 

 = CALCULATE(SUM(MyTable[number1]), PARALLELPERIOD(MyTable[Date],( ( 2019 - year(MyTable[Date]) ) * 12) ,MONTH) )
 
but il only returns data for 2019 !!! Any idea of my mistake ?
 
Tintin94230_0-1645544328771.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

number2 =
var _current='Table'[number1]
var _last=CALCULATE(SUM('Table'[number1]),FILTER(ALL('Table'),'Table'[Date]=DATE( YEAR(EARLIER('Table'[Date]))-1,MONTH(EARLIER('Table'[Date])),DAY(EARLIER('Table'[Date])))))
return
_current-_last

2. Result:

vyangliumsft_0-1645777233755.png

If I have misunderstood your meaning, please provide your desired output and your pbix file without privacy information.

 

Best Regards,

Liu Yang

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

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

number2 =
var _current='Table'[number1]
var _last=CALCULATE(SUM('Table'[number1]),FILTER(ALL('Table'),'Table'[Date]=DATE( YEAR(EARLIER('Table'[Date]))-1,MONTH(EARLIER('Table'[Date])),DAY(EARLIER('Table'[Date])))))
return
_current-_last

2. Result:

vyangliumsft_0-1645777233755.png

If I have misunderstood your meaning, please provide your desired output and your pbix file without privacy information.

 

Best Regards,

Liu Yang

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

Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Try to use calender date table in PARALLELPERIOD.

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Hello, you mean the calendar date that I use as "date" reference in my Power BI ? 

Calendrier =
ADDCOLUMNS(
CALENDAR(DATE(2019,01,01), TODAY()),
"Année" , year([Date]),
"Année Trimestre", Year([Date]) & "-Q" & Format([Date], "q"),
"Année Mois" , FORMAT([date],"YYYY MM"),
"Num Mois", FORMAT ( [Date], "MM" ),
"Mois", FORMAT([date],"MMMM"),
"Semaine", WEEKNUM([Date]),
"Trimestre", "Q" & FORMAT ( [Date], "Q" ),
"YearMonthShort", FORMAT ( [Date], "YYYY/mmm" ),
"MonthNameShort", FORMAT ( [Date], "mmm" ),
"DayOfWeekNumber", WEEKDAY ( [Date] ),
"DayOfWeek", FORMAT ( [Date], "dddd" ),
"DayOfWeekShort", FORMAT ( [Date], "ddd" )
)
Anonymous
Not applicable

they are linked 

Tintin94230_0-1645545090976.png

same issue with 

number2   = CALCULATE(SUM(MyTable[number1]), PARALLELPERIOD('Calendrier'[Date],( ( 2019 - year(MyTable[Date]) ) * 12) ,MONTH) )

@Anonymous Yes try to use it.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

number2   = CALCULATE(SUM(MyTable[number1]), PARALLELPERIOD('Calendrier'[Date],( ( 2019 - year(MyTable[Date]) ) * 12) ,MONTH) ) is giving the same result ... only resylts for 2019 dates !!! 
 
and when I try 
number2   = CALCULATE(SUM(MyTable[number1]), PARALLELPERIOD('Calendrier'[Date],( ( 2019 - year('Calendrier'[Date]) ) * 12) ,MONTH) ) ... I have power bi error saying too many values in Calendrier ... Tintin94230_0-1645545461439.png

 

 

@Anonymous Do you want to calculate 2019 and previous year on the same column?

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors