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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
HarryB
Resolver I
Resolver I

Weekly calendar date filter for the year starting on a Thursday

Hi Team,

Can anyone share a PBIX file which shows a weekly calendar starting on a Thursday from 2022-2024?

 

I also want to be able to filter data with a weekly slicer for the period 2022 - 2024

Thanks in advance

 

11-3012-712-1412-2112-281-41-111-181-252-12-82-152-22
2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @HarryB

Formula below is a sample DAX calendar table. This is a calculated table.

Calendar =
VAR __MIN =
    DATE ( 2022, 1, 1 )
VAR __MAX =
    DATE ( 2024, 12, 31 )
VAR __BASE =
    CALENDAR ( __MIN, __MAX )
VAR __RESULT =
    ADDCOLUMNS (
        ADDCOLUMNS (
            __BASE,
            "Year", YEAR ( [Date] ),
            "Month Long", FORMAT ( [Date], "mmmm" ),
            "Month Short", FORMAT ( [Date], "mmm" ),
            "Month Number", MONTH ( [Date] ),
            "Month and Year", FORMAT ( [Date], "mmm-yy" ),
            "YYYYMM", FORMAT ( [Date], "YYYYMM" ),
            "Quarter", "Q" & QUARTER ( [Date] ),
            "Day of Week Long", FORMAT ( [Date], "dddd" ),
            "Day of Week Short", FORMAT ( [Date], "ddd" ),
            "Day Sort", WEEKDAY ( [Date], 1 ),
            "Week of Year", WEEKNUM ( [Date] ),
            "Week Ending Saturday",
                VAR __DAY =
                    WEEKDAY ( [Date] ) - 7
                RETURN
                    [Date] - __DAY,
            "Week Ending Wednesday",
                VAR __DAY =
                    WEEKDAY ( [Date] ) - 4
                RETURN
                    [Date] - __DAY
        ),
        "Week Starting Thursday", [Week Ending Wednesday] - 6
    )
RETURN
    __RESULT

danextian_0-1709076368072.png

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

@danextian  thank you for your help . This is very helpful

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @HarryB

Formula below is a sample DAX calendar table. This is a calculated table.

Calendar =
VAR __MIN =
    DATE ( 2022, 1, 1 )
VAR __MAX =
    DATE ( 2024, 12, 31 )
VAR __BASE =
    CALENDAR ( __MIN, __MAX )
VAR __RESULT =
    ADDCOLUMNS (
        ADDCOLUMNS (
            __BASE,
            "Year", YEAR ( [Date] ),
            "Month Long", FORMAT ( [Date], "mmmm" ),
            "Month Short", FORMAT ( [Date], "mmm" ),
            "Month Number", MONTH ( [Date] ),
            "Month and Year", FORMAT ( [Date], "mmm-yy" ),
            "YYYYMM", FORMAT ( [Date], "YYYYMM" ),
            "Quarter", "Q" & QUARTER ( [Date] ),
            "Day of Week Long", FORMAT ( [Date], "dddd" ),
            "Day of Week Short", FORMAT ( [Date], "ddd" ),
            "Day Sort", WEEKDAY ( [Date], 1 ),
            "Week of Year", WEEKNUM ( [Date] ),
            "Week Ending Saturday",
                VAR __DAY =
                    WEEKDAY ( [Date] ) - 7
                RETURN
                    [Date] - __DAY,
            "Week Ending Wednesday",
                VAR __DAY =
                    WEEKDAY ( [Date] ) - 4
                RETURN
                    [Date] - __DAY
        ),
        "Week Starting Thursday", [Week Ending Wednesday] - 6
    )
RETURN
    __RESULT

danextian_0-1709076368072.png

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian  thank you for your help . This is very helpful

Welcome. Please accept my response as solution.










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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