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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PBI-Newbie
Helper I
Helper I

Dynamic Networkdays function with Dates from Slicer - Working Days

Dear all, 

 

I am trying to have a measure that calculates the following:

  1. Networkdays for a selected time period (chosen from the slicer "Date" from Calendar Table). I have a holiday calendar and NETWORKDAYS worked fine for the whole year, but not for the selected time period of the slicer
  2. Calculate "working time elapsed" so the first measure divided by the networkdays of the whole month. 

Thanks so much for everyones help!

1 ACCEPTED SOLUTION
PBI-Newbie
Helper I
Helper I

Thanks a lot @Anonymous ! In the meantime I use three different measures to get the desired calculation. 

  • Calendar Last Date=Calculate(Lastdate('Calendar[Date]))
  • Calendar First Date=Calculate(Firstdate('Calendar[Date]))
  • Networkdays([Calendar First Date],[Calendar Last Date],1,Values(Calendar_Holidays[Date]))

Might not be elegant, but worked out as well 🙂

View solution in original post

2 REPLIES 2
PBI-Newbie
Helper I
Helper I

Thanks a lot @Anonymous ! In the meantime I use three different measures to get the desired calculation. 

  • Calendar Last Date=Calculate(Lastdate('Calendar[Date]))
  • Calendar First Date=Calculate(Firstdate('Calendar[Date]))
  • Networkdays([Calendar First Date],[Calendar Last Date],1,Values(Calendar_Holidays[Date]))

Might not be elegant, but worked out as well 🙂

Anonymous
Not applicable

Hi @PBI-Newbie ,

Please have a try.

Networkdays = CALCULATE(
                COUNTROWS('Calendar'),
                FILTER('Calendar',
                    'Calendar'[Date] >= MIN('Date'[Date]) &&
                    'Calendar'[Date] <= MAX('Date'[Date]) &&
                    NOT('Calendar'[IsHoliday])
                )
            )
Working Time Elapsed = [Networkdays] / CALCULATE(
                                                COUNTROWS('Calendar'),
                                                FILTER('Calendar',
                                                    YEAR('Calendar'[Date]) = YEAR(MAX('Date'[Date])) &&
                                                    MONTH('Calendar'[Date]) = MONTH(MAX('Date'[Date])) &&
                                                    NOT('Calendar'[IsHoliday])
                                                )
                                            )

This formula calculates the networkdays of the whole month of the latest date selected in the slicer.

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.