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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Puja
Helper III
Helper III

Get only weekdays (exclude weekends) in measure

Hello all,

Is there a way to get  only weekdays (exclude weekends) for the next  6 months based on today's date in measure

 

Ex:Today() + 180 days and exclude weekends.

 

 

TIA

 

 

1 ACCEPTED SOLUTION
some_bih
Super User
Super User

Hi @Puja Below is code for creation of calculated tables with dates.

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

 

Weekdays_Table =
//create calculated table with weekdays 180 from today
//WEEKDAY function with values 2 means days Numbers 1 (Monday) through 7 (Sunday), so 6 and 7 are Saturday and Sunday
SELECTCOLUMNS (
    FILTER (
        CALENDAR ( TODAY(), TODAY() + 180 ),
        WEEKDAY ( [Date], 2 ) < 6
    ),
    "WeekdayDate", [Date]
)




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

Proud to be a Super User!






View solution in original post

3 REPLIES 3
some_bih
Super User
Super User

Hi @Puja Below is code for creation of calculated tables with dates.

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

 

Weekdays_Table =
//create calculated table with weekdays 180 from today
//WEEKDAY function with values 2 means days Numbers 1 (Monday) through 7 (Sunday), so 6 and 7 are Saturday and Sunday
SELECTCOLUMNS (
    FILTER (
        CALENDAR ( TODAY(), TODAY() + 180 ),
        WEEKDAY ( [Date], 2 ) < 6
    ),
    "WeekdayDate", [Date]
)




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

Proud to be a Super User!






some_bih
Super User
Super User

Hi @Puja for measure one of approach is as shown below:

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

 

#WeekdaysNextSixMonths =
//calculation of weekdays 180 from today
VAR _start_date = TODAY() // start date
VAR _end_date = _start_date + 180 // calculate 180 from today
VAR NumDays = _end_date - _start_date + 1
VAR _Result =
    SUMX(
        GENERATESERIES(_start_date, _end_date, 1),
        IF(
            WEEKDAY([Value]) <> 1 && WEEKDAY([Value]) <> 7,
            1,
            0
        )
    )
//WEEKDAY with values 1 and 7 means Saturday and Sunday is excluded
RETURN
    _Result

some_bih_0-1689077873240.png

 





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

Proud to be a Super User!






Hi @some_bih ,

Thank you . I need to get DATES  and not  number (129). Sorry I was not clear in my request. 

Like below exclude weekends.

7/11/2023
7/11/2023
7/11/2023
7/11/2023
7/11/2023
7/11/2023
7/12/2023
7/12/2023
7/12/2023
7/12/2023
7/12/2023
7/12/2023
7/13/2023
7/13/2023
7/13/2023
7/13/2023
7/13/2023
7/13/2023
7/14/2023
7/14/2023
7/14/2023
7/14/2023
7/14/2023
7/14/2023
7/17/2023
7/17/2023
7/17/2023
7/17/2023
7/17/2023
7/17/2023
7/18/2023
7/18/2023
7/18/2023
7/18/2023
7/18/2023
7/18/2023
7/19/2023
7/19/2023
7/19/2023
7/19/2023
7/19/2023

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.