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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
VictorCoulmont
New Member

Date table with week from saturday to friday

Hi every one, 
I currently have this Table for my dates :

DATE = ADDCOLUMNS(
    CALENDAR(DATE(2010,1,1),DATE(2025,12,31)),
    "Year",YEAR([Date]),
    "Num Mounth",MONTH([Date]),
    "Name Mounth",FORMAT([Date],"MMMM"),
    "Name Day",FORMAT([Date],"DDDD"),
    "Num Week",FORMAT([Date],"\Se\mai\ne WW") ,
    "Year Week",FORMAT ( [Date], "YYYY" ) & " - " & FORMAT(WEEKNUM([Date],21),"00"),
    "Week Number",FORMAT(WEEKNUM([Date],21),"00"),
    "Mounth Year",FORMAT([Date],"MM/ YYYY"),
    "Year Mounth",FORMAT([Date],"yyyy/mm"),
    "Day Number",WEEKDAY([Date],2)
    )

With this table my week are from monday to sunday,

I'd like to keep the same table but with my weeks from saturday to friday, i don't want new column !

Can you help me ? 

Thanks ! 
1 ACCEPTED SOLUTION
VictorCoulmont
New Member

Thanks, I Tryed and it almost works ! 
I Just changed something !
ADDCOLUMNS(
    CALENDAR(DATE(2010,1,1), DATE(2025,12,31)),
    "Year", YEAR([Date]),
    "Num Mounth", MONTH([Date]),
    "Name Mounth", FORMAT([Date], "MMMM"),
    "Name Day", FORMAT([Date], "DDDD"),
    "Num Week",
                IF(
                    WEEKDAY([Date],2) >= 6,
                    IF(
                        WEEKNUM([Date], 21) = 52,
                        1,
                        WEEKNUM([Date], 21) + 1
                    ),
                    WEEKNUM([Date], 21)
                ),
    "Year Week", YEAR([Date]) & " - " &
                    IF(
                        WEEKDAY([Date],2) >= 6,
                        IF(
                            WEEKNUM([Date], 21) = 52,
                            1,
                            WEEKNUM([Date], 21) + 1
                        ),
                        WEEKNUM([Date], 21)
                    ),
    "Week Num",IF(
                            WEEKDAY([Date],2) >= 6,
                            IF(
                                WEEKNUM([Date], 21) = 52,
                                1,
                                WEEKNUM([Date], 21) + 1
                            ),
                            WEEKNUM([Date], 21)
                        ),
    "Mounth Year", FORMAT([Date], "MM/YYYY"),
    "Year Mounth", FORMAT([Date], "yyyy/MM"),
    "Day Number", WEEKDAY([Date], 2)
)

With that it works fine ! 

 

View solution in original post

2 REPLIES 2
VictorCoulmont
New Member

Thanks, I Tryed and it almost works ! 
I Just changed something !
ADDCOLUMNS(
    CALENDAR(DATE(2010,1,1), DATE(2025,12,31)),
    "Year", YEAR([Date]),
    "Num Mounth", MONTH([Date]),
    "Name Mounth", FORMAT([Date], "MMMM"),
    "Name Day", FORMAT([Date], "DDDD"),
    "Num Week",
                IF(
                    WEEKDAY([Date],2) >= 6,
                    IF(
                        WEEKNUM([Date], 21) = 52,
                        1,
                        WEEKNUM([Date], 21) + 1
                    ),
                    WEEKNUM([Date], 21)
                ),
    "Year Week", YEAR([Date]) & " - " &
                    IF(
                        WEEKDAY([Date],2) >= 6,
                        IF(
                            WEEKNUM([Date], 21) = 52,
                            1,
                            WEEKNUM([Date], 21) + 1
                        ),
                        WEEKNUM([Date], 21)
                    ),
    "Week Num",IF(
                            WEEKDAY([Date],2) >= 6,
                            IF(
                                WEEKNUM([Date], 21) = 52,
                                1,
                                WEEKNUM([Date], 21) + 1
                            ),
                            WEEKNUM([Date], 21)
                        ),
    "Mounth Year", FORMAT([Date], "MM/YYYY"),
    "Year Mounth", FORMAT([Date], "yyyy/MM"),
    "Day Number", WEEKDAY([Date], 2)
)

With that it works fine ! 

 

rajendraongole1
Super User
Super User

Hi @VictorCoulmont  Slight modification but it works

 

DATEID =
ADDCOLUMNS(
    CALENDAR(DATE(2010,1,1), DATE(2025,12,31)),
    "Year", YEAR([Date]),
    "Num Month", MONTH([Date]),
    "Name Month", FORMAT([Date], "MMMM"),
    "Name Day", FORMAT([Date], "DDDD"),
    "Num Week", WEEKNUM([Date], 21),
    "Year Week", YEAR([Date]) & " - " &
                IF(
                    WEEKDAY(DATE(YEAR([Date]),1,1),1) > 6,
                    WEEKNUM([Date], 21) - 1,
                    WEEKNUM([Date], 21)
                ),
    "Week Number", IF(
                        WEEKDAY(DATE(YEAR([Date]),1,1),1) > 6,
                        WEEKNUM([Date], 21) - 1,
                        WEEKNUM([Date], 21)
                    ),
    "Month Year", FORMAT([Date], "MM/YYYY"),
    "Year Month", FORMAT([Date], "yyyy/MM"),
    "Day Number", WEEKDAY([Date], 2),
    "Week Start Date", [Date] - WEEKDAY([Date], 1) + 1 - IF(WEEKDAY([Date], 1) = 7, 6, 0),  -- Calculate the Saturday of the week
    "Week End Date", [Date] - WEEKDAY([Date], 1) + 7 - IF(WEEKDAY([Date], 1) = 7, 6, 0)     -- Calculate the Friday of the week
)


 

rajendraongole1_1-1716987157215.png

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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