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
Tyler99
New Member

How to include IF Start date / End date is blank then ignore

Hi,

 

I am a beginner in Power BI and I am trying to get the number of day from start date/end date. 

Its proving a challenge as I needed it to be work days mon-fri.

 

Below is the DAX used for my column but its providing me with an error - The start date or end date in Calendar function can not be Blank value.

 

I am assuming this is because some of the rows start date or end date, may be blank. However I want to to ignore them and just give me the days for the ones with a start and end date.

 

I have tried putting in an IF statement but it did not seem to work as I really have no clue where to input it.

 

Weekdays = COUNTROWS(
    FILTER(
        ADDCOLUMNS(
            CALENDAR('IT - Projects/Resource Tracker'[Start Date],
            'IT - Projects/Resource Tracker'[End Date]),
            "Day of Week",
            WEEKDAY([Date], 2) ),
            [Day of Week] <> 6 &&
            [Day of Week] <> 7 ))
 
Would really appricate the help.
 
Thanks 
1 ACCEPTED SOLUTION
AilleryO
Memorable Member
Memorable Member

Hi,

 

Why not using the NETWORKDAYS function in DAX, especially if you just need to remove satudays and sundays.

If you have to deal with bank holidays then you'd better set them in a Date Table.

You can even set some bank holidays in NETWORKDAYS but it might be more easy with a date table.

 

So if you just need to remove saturdays and sundays, networkdays(startdate, enddate) is perfect.

If you want more details about the funtion :

https://learn.microsoft.com/en-us/dax/networkdays-dax

 

Let us know if it works or if you need more information

View solution in original post

1 REPLY 1
AilleryO
Memorable Member
Memorable Member

Hi,

 

Why not using the NETWORKDAYS function in DAX, especially if you just need to remove satudays and sundays.

If you have to deal with bank holidays then you'd better set them in a Date Table.

You can even set some bank holidays in NETWORKDAYS but it might be more easy with a date table.

 

So if you just need to remove saturdays and sundays, networkdays(startdate, enddate) is perfect.

If you want more details about the funtion :

https://learn.microsoft.com/en-us/dax/networkdays-dax

 

Let us know if it works or if you need more information

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.