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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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