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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Networkdays issue with filtering holidays

I have an issue: Approach of calculation network days does not work. I Prepared everything by instruction which is presented here (https://www.youtube.com/watch?v=9M1V_m-oEzc)

Link on pbix.

https://app.box.com/s/8jqxm88ik0850lh2llt6zrfwyyek056r

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

We can take the following steps to meet your requirement.

 

1. Update one of your formulas 

From

WorkingDays = IF(OR('Date'[Date]=6, 'Date'[Date]=7),0, 1)

To

WorkingDays = IF(OR('Date'[WeekDay]=6,'Date'[WeekDay]=7),0,1)


2. Create a new column.

workday = IF('Date'[WorkingDays]=1,DAY('Date'[Date]),BLANK())


3. Then we can get the result we need.

 

22.png

 

For more details, please check the pbix as attached.

https://www.dropbox.com/s/3b68yfqbdz3vo9n/NetWorkDays2.1.pbix?dl=0

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Based on my test, I can calculate the net workdays by the way as the video.


1. Create a Date table and a holiday table.
2. Add two columns in the Date one.

weekday = WEEKDAY('date'[Date])
weekdays = IF(OR('date'[weekday]=6,'date'[weekday]=7),0,IF(ISBLANK(RELATED(Hiliday[holi])),1,0))

 


3. To get the new workdays, we can use this measure as below.

days = CALCULATE(SUM('date'[weekdays]),FILTER('date','date'[weekdays]=1))

Then we can get the result as below.

 

1.png


For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/iyrynlunt15xrm3/Networkdays%20issue%20with%20filtering%20holidays.pbix?dl=0

 

By the way, I cannot get your pbix you shared. Could you please share that to me again if necessary?

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi Frank!

 

Could you please check this link: https://app.box.com/s/8jqxm88ik0850lh2llt6zrfwyyek056r

I see that it works in case when you have additional data by holiday.

But I need to exclude just weekends (Saturday and Sunday) 

As a result I would like to see something like that:

Untitled.png

 

Untitled.png

Hi @Anonymous,

 

We can take the following steps to meet your requirement.

 

1. Update one of your formulas 

From

WorkingDays = IF(OR('Date'[Date]=6, 'Date'[Date]=7),0, 1)

To

WorkingDays = IF(OR('Date'[WeekDay]=6,'Date'[WeekDay]=7),0,1)


2. Create a new column.

workday = IF('Date'[WorkingDays]=1,DAY('Date'[Date]),BLANK())


3. Then we can get the result we need.

 

22.png

 

For more details, please check the pbix as attached.

https://www.dropbox.com/s/3b68yfqbdz3vo9n/NetWorkDays2.1.pbix?dl=0

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @Anonymous,

 

Does that make sense? If so , could you please mark this answer as a solution?

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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