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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
noliverte
Helper III
Helper III

Weekyear ISO comparison

Hello,

 

I have 1  table  with details of the sessions each days (2015-->2020) Named Freq-web-all

treq_table.PNG

 

I have a calendar calculated field Named Calendrier

calendrier.PNG

I linked these 2 tables in the model view on date (date with calendar date)

 

I would like to show sessions evolution (%) between week w-1 et week w-2 based on today's date

(today is wednesday 09/12/2020 , week 50... I would like to display the sum of my sessions week 49 and 48)

 

What I tried :

  • insert weekyear number in my sessions table but I didn't succeed. (with iso version)
  • sum sessions with a filter based on the weekyear ISO number

Could you help to build my measure based on W-1 ?

 

A response would be greatly appreciated

 

Have a nice day

 

Noliverte

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @noliverte ,

 

You can create a yearweek number like this

calendar =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2015, 1, 1 ), TODAY () ),
    "yearweek",
        YEAR ( [Date] ) & "-"
            & WEEKNUM ( [Date] ),
    "sort",
        YEAR ( [Date] ) * 100
            + WEEKNUM ( [Date] )
)

 

For filtering the value you want, you could create a relationship between the calendar table and the main table.

5.png

 

The sort column is created to sort the yearweek colulmn.

6.png

 

After the above steps are completed, you can create a view to filter.

7.png

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @noliverte ,

 

You can create a yearweek number like this

calendar =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2015, 1, 1 ), TODAY () ),
    "yearweek",
        YEAR ( [Date] ) & "-"
            & WEEKNUM ( [Date] ),
    "sort",
        YEAR ( [Date] ) * 100
            + WEEKNUM ( [Date] )
)

 

For filtering the value you want, you could create a relationship between the calendar table and the main table.

5.png

 

The sort column is created to sort the yearweek colulmn.

6.png

 

After the above steps are completed, you can create a view to filter.

7.png

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors