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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Quentin_B
New Member

Period comparison problems using Weeks (ISO-8601)

Hi everyone, 

As a rookie on Power BI, I'm strugling for days on a date comparison using ISO 8601 weeks' standard.

Here is my 'Date' Table, as you can see, I created a column for the Year ISO ("Année ISO") and the last line is for the Week ISO ("Semaine ISO"). Looking at the results, both are working as the first line's date is "2018-12-31" but appears as Week n°1 and year 2019 is the last 2 columns.

Quentin_B_2-1714057440600.png

 

The table 'fr_iso_Footfall' associated with is the one below. They are linked by 'st_date" column.
Again year_iso and week_iso are correct in this table (save the yellow numbers for later) :

Quentin_B_8-1714060417103.png

 

 

Now, I'd like to compare on the same line, the results per week for 2023, 2022 and 2019 like the graph below:

Quentin_B_7-1714059069907.png

The numbers for 2023 & 2022 are correct, but for 2019, it is not the good ones by 1 week.
If you look up the yellow numbers, I'm supposed to have for 'year_iso' = 2019 and 'week_iso' =1 -> 217 041
I have week_iso = 2 instead (300 322).


BUT if I add the lines for 2019, in this case, the good values are in the right places (see below)

Quentin_B_6-1714059012778.png

 

So I can't understand why the data for 2019 alone are correct, but wrong when in comparison with 2023.
It looks like it is due to the link betwin the tables on "st_date" as I use the 'date'[date] to compare the dates in my measures (they are the end of the post) for 2022 and 2019.
As a confirmation, I tried to see if it changes the results if the link is set on "end_date", and yes Week_1 for year_2019 was correct, but the problem was then reported on weeks 52 or 53 if these were ending the year after (e.g: ISO_Year: 2022; ISO_Week: 52 ending date is 2023-01-01).

Any help would be highly appreciated 🙂

 

Here are my measures:
footfall_23  = SUM(fr_iso_Footfall[footfall])

 

footfall_22 = CALCULATE(fr_iso_Footfall[footfall_iso_N],SAMEPERIODLASTYEAR('Date'[Date]))

 

footfall_19 = CALCULATE(fr_iso_Footfall[footfall_iso_N],
   DATEADD ( 'Date'[Date],

   CALCULATE ( ( YEAR ( MAX ( 'Date'[Date] ) ) - 2019 ) * ( -1 ) ),
   YEAR ))

 

Sorry for the long post and thank you very much for those reading these lines. 
Have a good day.

 

1 REPLY 1
lbendlin
Super User
Super User

You cannot use SAMEPERIODLASTYEAR etc for custom calendars. But you should be able to do this via the columns in your Dates table.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors