Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
How to exclude start date in below function
Solved! Go to Solution.
Hi @Anonymous ,
The formula "weekday(DateDim[ActualDate],2)<=5) " is used to get the dates which is working day. You can refer this documentation about the details of function WEEKDAY .
You can update the formula of the related calculated column as below:
Daysdiff=
var a= DATEDIFF('All'[StartDate],'All'[EndDate], DAY) -
(
CALCULATE (
COUNTROWS('DateDim'),
WEEKDAY('DateDim'[ActualDate],2)>5,
DATESBETWEEN('DateDim'[ActualDate], 'All'[StartDate], 'All'[EndDate])
)
)
return
if(a<0,0,a)Best Regards
Rena
Hi @Anonymous ,
Please try to use the function DATEDIFF:
Days = DATEDIFF ( All[SartDate], 'All'[EndDate], DAY )Best Regards
Rena
Using DateDiff, how can I exclude weekends?
Hi @Anonymous ,
What is your expected result? You want the number of days between StartDate and EndDate exclude weekends? If yes, please check if the following screenshot is your expected result?
And you refer the start date need to be excluded, then the final days between 1/9/2019 and 1/14/2019 should be 3 not 5 since it need to exclude weekends and start date....
Best Regards
Rena
Yes expected result is 3. Could you explain why you used
Thanks
Hi @Anonymous ,
The formula "weekday(DateDim[ActualDate],2)<=5) " is used to get the dates which is working day. You can refer this documentation about the details of function WEEKDAY .
You can update the formula of the related calculated column as below:
Daysdiff=
var a= DATEDIFF('All'[StartDate],'All'[EndDate], DAY) -
(
CALCULATE (
COUNTROWS('DateDim'),
WEEKDAY('DateDim'[ActualDate],2)>5,
DATESBETWEEN('DateDim'[ActualDate], 'All'[StartDate], 'All'[EndDate])
)
)
return
if(a<0,0,a)Best Regards
Rena
Thanks for the solution. It Worked, but for some reason "weekday(DateDim[ActualDate],2)<=5) is not working for me, so instead I used 'DateDim'[IsWeekend] = TRUE().
Thanks for the solution. It Worked, but for some reason "weekday(DateDim[ActualDate],2)<=5) is not working for me, so instead I used 'DateDim'[IsWeekend] = TRUE().
Daysdiff=
var a= DATEDIFF('All'[StartDate],'All'[EndDate], DAY) -
(
CALCULATE (
COUNTROWS('DateDim'),
DATESBETWEEN('DateDim'[ActualDate], 'All'[StartDate], 'All'[EndDate]),
'DateDim'[IsWeekend] = TRUE()
)
)
return
if(a<0,0,a)
Using DateDiff, how can I exclude weekends?
Column = ([EndDate] - [StartDate]) * 1.
Measure = (MAX([EndDate]) - MAX([StartDate])) * 1.
Not Working
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 22 | |
| 20 | |
| 17 | |
| 13 | |
| 13 |
| User | Count |
|---|---|
| 62 | |
| 41 | |
| 39 | |
| 38 | |
| 38 |