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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
CPL_HK
Frequent Visitor

Calculation of historical waiting list

Hi everybody, I would appreciate your help in solving the following problem: A doctor knows when patients were registered and when they were examined. He wants to understand the historical length of the resulting waiting list. 

 

Datatable looks like this: 

Examination Number - Date of registration - Date of Examination 

 

I have a line chart in which I would like to show the historical length of the waiting list at the end of a specific week. The x axis is using calendar weeks from a date table. Length of the waiting list means the number of rows where the date of registration was before the end of a specific calendar week AND the date of examination is after the end of a specific calendar week. I would ideally do this using a measure (I made an attempt using a dedicated table which was counting the entries for each date with the conditions above, however, it didn't work out for performance reasons, and I had problems filtering it). 

 

Any guidance would be highly appreciated. 

 

Best, 

Christian 

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@CPL_HK ,Can you share sample data and sample output in table format?

See if this blog can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

I attached an excel file with the desired calculations. 

 

Step 1 would be to just calculate the waiting list on a daily basis. Step two to generate a table/chart on a weekly basis. I seperated the steps to make it clearer. 

 

I already made an attempt using a dedicated date table where I did the same calculation as in the Excel file using calculate/filter, however it proved to be slow and not very elegant, so I would like to use a measure to do this calculation.... 

 

https://www.file-upload.net/download-14191041/WaitingListProblem.xlsx.html

 

parry2k
Super User
Super User

@CPL_HK share sample data and expected output, it will help to provide the solution.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.