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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DAX_Defender
New Member

NETWORKDAYS with filtered column of dates

Hello Wonderful Community and a Happy Monday to you all,

 

Hopefully a fairly quick and simple question for you here. I'm pretty excited about NETWORKDAYS hitting Power BI and so was hoping to use it in combination with a UK .gov API of Holidays. 

I've succesfully pulled in the table from the API and placed a few filters on it to get just this year's Bank Holidays, and thought I'd test NETWORKDAYS in the run-up to Christmas (on the hottest day ever!). 

 

As per https://hello-safe.co.uk/business-insurance/tools/working-days-calculator, I'm expecting the result of 114 for England and Wales and 113 for Scotland. 

 

As per the documentation, I'm using the following for my DAX column; 

 

daysToChristmas = 
VAR _BankHolidays = {'bank-holidays'[events.date]}
RETURN NETWORKDAYS(TODAY(), DATE(2022,12,25), 1, _BankHolidays)

 

 

But this is my results (noting Scotland is one day out and the tables are correct). It's as if it's only subtracting one holiday.  

NetworkDays.jpg

 

Appreciate this can be done via other means, but really want to crack this with this DAX function. 

 

Any help, greatly appreciated! 

 

Edit: API endpoint is here, allows anonymous access:

https://www.gov.uk/bank-holidays.json 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Use VALUES instead, 

Days to Xmas = NETWORKDAYS( TODAY(), DATE(2022, 12, 25), 1, VALUES('bank-holidays'[events.date]) )

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Use VALUES instead, 

Days to Xmas = NETWORKDAYS( TODAY(), DATE(2022, 12, 25), 1, VALUES('bank-holidays'[events.date]) )

Absolute legend, worked like a charm. Thank you very much for the quick response. 

NetworkDays2.jpg

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors