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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Truelearner
Helper III
Helper III

grouping data for custom category

Hi ALL, i have data of an emp login who works for multiple clients , employee logs hours he worked for each client he worked for and i have summaried the total hours employee worked on a day in a column "Hours per day" ,  Now i want to bin the data  like the second table , 0-7 hours as one bin , 7-9 hours as one bin , above 9 hours as one bin , can someone please help  

 

Empclient DatehoursHourrs per day
1A5/15/202013.5
1B5/15/20201.53.5
1C5/15/202013.5
1D5/16/2020410
1E5/16/2020610
2A5/15/2020611
2B5/15/2020211
2C5/15/2020311
2D5/16/202019
2E5/16/202089

 

 

 

Emp10 to 77 to 9Above 9
1101
2011

 

@v-chuncz-msft @amitchandak @v-wxu@mgwena @cham @cham @amitchandak @Greg_Deckler @Mariusz @Mariusz @yij @yij v-yingj@ v-diye-msft@ @v-eachen-msft @v-juanli-msft @v-jayw-msf @v-zhenbw-msft  @harshnathani

 

1 ACCEPTED SOLUTION

Hi  @Truelearner , 

You could try below measure and refer to my sample for details.

Measure 2 = COUNTX(SUMMARIZE('Table (2)','Table (2)'[Emp],'Table (2)'[Date],'Table (2)'[status]),'Table (2)'[status])+0

 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Truelearner
Helper III
Helper III

can someone from community support take a look at it please 

@Truelearner can you share pbix file with sample data and expected output and I will look at it. My solution answered the original question you posted but seems like there is more than that. 



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.

parry2k
Super User
Super User

@Truelearner add a new column for the bin

 

Bin = 
SWITCH ( TRUE(),
 Table[Columns] > 9, "More than 9 hours"
 Table[Columns] > 7, "7 - 9",
 "0-7"
)

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



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.

if i create a column that column will reference the total hours in a day and the count associated with the duplicated depending on the number of line items that employee have on that day . 

 
 
 

1.png2.png

Hi @Truelearner , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

The logic you provided will for the sample data but the real data will have multiple days with same hours in those scenarios it will fails ,please check the below data where the logic provided will break ,

 

bascially i added two rows for employee 1 for for may 17 and the total working hours is same as working hours on 16th may and when i added you logic its failing . Kindly check

 

 

EmpclientDatehoursHourrs per dayColumn

1AFriday, May 15, 202013.5below 7
1BFriday, May 15, 20201.53.5below 7
1CFriday, May 15, 202013.5below 7
1DSaturday, May 16, 2020410above 9
1ESaturday, May 16, 2020610above 9
2AFriday, May 15, 2020611above 9
2BFriday, May 15, 2020211above 9
2CFriday, May 15, 2020311above 9
2DSaturday, May 16, 202019below 9
2ESaturday, May 16, 202089below 9
1DSunday, May 17, 2020410above 9
1ESunday, May 17, 2020610above 9
 

Hi  @Truelearner , 

You could try below measure and refer to my sample for details.

Measure 2 = COUNTX(SUMMARIZE('Table (2)','Table (2)'[Emp],'Table (2)'[Date],'Table (2)'[status]),'Table (2)'[status])+0

 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.