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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Austen229022
Helper II
Helper II

Power Query Duration between Dates excluding Weekends Wont Load

I am using a database to import rows of details into my dashboard, with a calculation of working days between the Received and the Issued dates. There are around 120k rows, and only have Case ID, Received Date, Issued Date and 2 other columns in the table.

 

A Calendar list has been created taking out all the working days so it is just weekends and public holidays.

From this, I have created a query as follows:

(StartDate as date, EndDate as date, HolidayList as list) as number=>
let
    DateList=List.Dates(StartDate,Number.From(EndDate-StartDate)+1,#duration(1,0,0,0)),
    //create series of Dates
    RemoveHolidays=List.RemoveItems(DateList, HolidayList),
    //remove holidays
    Countdays=List.Count(RemoveHolidays)
    //count days
in
  Countdays

 

 

When I then add this into my table as below, it takes literal hours to load and I have to close the program through the Task Manager.

 

Can anyone help with this issue so that it will actually load? 

1 ACCEPTED SOLUTION

Hi @Austen229022,

I have reproduced your scenario in Power BI as per your requirements. Please find attached.pbix file for your reference. 



If this response helps, consider marking it as “Accept as solution” and giving a “kudos” to assist other community members.
Thank you.

View solution in original post

7 REPLIES 7
v-priyankata
Community Support
Community Support

Hi @Austen229022 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-priyankata
Community Support
Community Support

Hi @Austen229022 
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

maruthisp
Super User
Super User

Hi Austen229022,
Instead of doing the step in Power Query, can you try doing with DAX?
Step-1: Create a Date table with excluding weekends and holidays
Step-2: Use the above Date table to join with your table

Best regards,
Maruthi

How can you do this with DAX?

Hi @Austen229022,

I have reproduced your scenario in Power BI as per your requirements. Please find attached.pbix file for your reference. 



If this response helps, consider marking it as “Accept as solution” and giving a “kudos” to assist other community members.
Thank you.

Hi @Austen229022 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you

Ashish_Excel
Super User
Super User

Hi,

It may be better to do this in DAX as a calculated column formula.  Share some data to work with and show the expected result.  Also share the list of public holidays.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors