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! Learn more

Reply
Anonymous
Not applicable

NETWORK DAYS

Hi community,

On Powerquery, I have two columns containing a start and end date, but I will like to  calculate the number of working days, in a custom column.  I would really appreciate any help with this.

Thank you.

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Anonymous  , Try using this method 

 

  1. Open the Power Query Editor.

  2. Select the table that contains your start and end date columns.

  3. Go to the "Add Column" tab and click on "Custom Column."

  4. In the "Custom Column" dialog box, provide a name for the new column (e.g., "WorkingDays").

  5. Use the following formula to calculate the working days:

     

    M
    WorkingDays = List.Difference( List.Dates([StartDate], Duration.From([EndDate] - [StartDate]) + #duration(1, 0, 0, 0)), List.Dates([StartDate], Duration.From([EndDate] - [StartDate]) + #duration(1, 0, 0, 0), #duration(1, 0, 0, -1)), (a, b) => Date.ToText(a) = Date.ToText(b) ), WorkingDaysCount = List.Count(WorkingDays)

     

     

    Please accept as solution if it helps 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
bhanu_gautam
Super User
Super User

 , Try using this method 

 

  1. Open the Power Query Editor.

  2. Select the table that contains your start and end date columns.

  3. Go to the "Add Column" tab and click on "Custom Column."

  4. In the "Custom Column" dialog box, provide a name for the new column (e.g., "WorkingDays").

  5. Use the following formula to calculate the working days:

     

    M
    WorkingDays = List.Difference( List.Dates([StartDate], Duration.From([EndDate] - [StartDate]) + #duration(1, 0, 0, 0)), List.Dates([StartDate], Duration.From([EndDate] - [StartDate]) + #duration(1, 0, 0, 0), #duration(1, 0, 0, -1)), (a, b) => Date.ToText(a) = Date.ToText(b) ), WorkingDaysCount = List.Count(WorkingDays)

     

     

    Please accept as solution if it helps 

@Anonymous




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






bhanu_gautam
Super User
Super User

@Anonymous  , Try using this method 

 

  1. Open the Power Query Editor.

  2. Select the table that contains your start and end date columns.

  3. Go to the "Add Column" tab and click on "Custom Column."

  4. In the "Custom Column" dialog box, provide a name for the new column (e.g., "WorkingDays").

  5. Use the following formula to calculate the working days:

     

    M
    WorkingDays = List.Difference( List.Dates([StartDate], Duration.From([EndDate] - [StartDate]) + #duration(1, 0, 0, 0)), List.Dates([StartDate], Duration.From([EndDate] - [StartDate]) + #duration(1, 0, 0, 0), #duration(1, 0, 0, -1)), (a, b) => Date.ToText(a) = Date.ToText(b) ), WorkingDaysCount = List.Count(WorkingDays)

     

     

    Please accept as solution if it helps 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.