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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
EloiseJane
Frequent Visitor

Direct Query working day count date dax

Hi

 

HELP...

 

I am trying to do a date between count with some direct query data to estabish the amount of working days between application received and application validated.

 

I have tried calulate(sum of working days(date between function) on an import that works, but my data set is to big for an import so i need to find a way around the limiation for direct query. Any ideas please?! i have an calander ref point already in my model.

 

thanks

Eloise

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @EloiseJane ,

 

Since this: i have an calander ref point already in my model. Please try:

Measure =
VAR _t =
    FILTER (
        ADDCOLUMNS ( 'Calendar', "WeekDay", WEEKDAY ( [Date], 2 ) ),
        [Date] >= MAX ( 'DateTable'[application received] )
            && [Date] <= MAX ( 'DateTable'[application validated] )
            && [WeekDay] IN { 1, 2, 3, 4, 5 }
    )
RETURN
    COUNTROWS ( _t )

Eyelyn9_0-1634869381876.png

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
Anonymous
Not applicable

Hi @EloiseJane ,

 

Since this: i have an calander ref point already in my model. Please try:

Measure =
VAR _t =
    FILTER (
        ADDCOLUMNS ( 'Calendar', "WeekDay", WEEKDAY ( [Date], 2 ) ),
        [Date] >= MAX ( 'DateTable'[application received] )
            && [Date] <= MAX ( 'DateTable'[application validated] )
            && [WeekDay] IN { 1, 2, 3, 4, 5 }
    )
RETURN
    COUNTROWS ( _t )

Eyelyn9_0-1634869381876.png

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

amitchandak
Super User
Super User

@EloiseJane , You can try a measure like

Work Day = COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR(Min(Table[Start Date]),Max(Table[End Date])),"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),[WorkDay] =1))

 

or

 

Work Day = sumx(values(Table[ID]), COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR(Min(Table[Start Date]),Max(Table[End Date])),"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),[WorkDay] =1)) )

 

 

refer

Business Days/ Workdays, with or without date table: https://youtu.be/Qv4wT8_P-AA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.