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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rfickes
Frequent Visitor

Binning Elements (Unique Client IDs) Based on Summation of Another Element (Hours of Service)

I will try to lay this out as clearly as I can.

 

I have a database where each row indicates a unique visit that a client received from a caregiver. Each visit includes important elements such as the duration of the visit, the date of the visit, and a client ID.

 

I need to pull out of this and get into a stacked bar histogram count of the number of clients in any given week who received 0.00 - 9.99 hours of care, 10.00 - 40.00 hours of care, and 40.01+ hours of care.

 

Binning the dates into weeks is obviously not difficult - create a group with a bin size of 7 days. However, I'm not sure how to create the bins for hours of care received, because the hours of care will have to be summed across multiple visits in a given week.

 

Any assistance would be greatly appreciated.

 


Sample Data: 

Visit IDClient IDDateHours
141/1/20182
211/3/20189
331/5/20183
421/7/201810
551/9/201810
611/11/20182
731/13/20184
851/15/201812
911/17/201810
1031/19/20189
1151/21/20183
1251/23/201812
1351/25/20183
1431/27/201812
1521/29/20188
1651/31/20185
1712/2/201811
1822/4/20188
1942/6/20186
2012/8/20189
1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

I'd look to go to Power Query and:

 

- assign each row a week number based on whatever periods you use

- from there, group the rows where the client ID and week number match, adding the total hours

 

It should then be a bit easier to get to the result you want

View solution in original post

1 REPLY 1
jthomson
Solution Sage
Solution Sage

I'd look to go to Power Query and:

 

- assign each row a week number based on whatever periods you use

- from there, group the rows where the client ID and week number match, adding the total hours

 

It should then be a bit easier to get to the result you want

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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