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
Anonymous
Not applicable

count no of days in a row having work days

Hello

 

I would like to calculate the days from the below workday list.

 

The result should be 5.

 

Thank you

 

Workdays

01-Jan-2023
03-Jan-2023
01-jan-2023
04-Jan-2023
04-Jan-2023
04-Jan-2023
05-Jan-2023
06-Jan-2023
06-Jan-2023
06-jan-2023
1 ACCEPTED SOLUTION

Hi @Anonymous 

I think I understand.

Would this help?

 

zCount = DISTINCTCOUNT( 'Workdays'[Workday] )
 

Let me know if I'm misunderstanding your post.

 

View solution in original post

6 REPLIES 6
Padycosmos
Solution Sage
Solution Sage

Hope this helps:

Padycosmos_0-1677843195209.png

 

 

 

grantsamborn
Solution Sage
Solution Sage

Hi @Anonymous 

I'm not sure how you arrive at a result of 5.

Since a) there was no "02-Jan-2023" and b) having a span of 6 days would include a weekend day, I would like you to explain your expected result of 5 workdays in a row.

 

(Edited to add:  Part b) is actually irrelevant since if there is 1 day off inside of any 6 day period, the maximum would be 4 days in a row - regardless of if they are working days or not.)

Anonymous
Not applicable

Hello grantsmborn

 

My requirement is to count no days and need to be excluded if the date is repeated. In the example if you consider 1-Jan-2023,3-Jan-2023,4-Jan-2023,5-jan-2023 ,6-Jan-2023 so total 5 days.

Hi @Anonymous 

I think I understand.

Would this help?

 

zCount = DISTINCTCOUNT( 'Workdays'[Workday] )
 

Let me know if I'm misunderstanding your post.

 

Padycosmos
Solution Sage
Solution Sage

Hope this helps:

Padycosmos_0-1677784600278.png

 

Andy1984
Frequent Visitor

@Anonymous 

 

I do not know your data set. for example you can try it with a measure like this:

 

count_workdays = NETWORKDAYS( DATE(2022,10,1), //start date

                                                          DATE(2022,10,31), //end date

                                                          7 )

 

Counts the days between the start date and end date, ignoring weekend days. 

 

7 = Friday and Saturday 

8 = Saturday and Sunday 

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.

Top Solution Authors
Top Kudoed Authors