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
Anonymous
Not applicable

Grouping Data into Two Different Buckets

Hello, I've frequently used other users questions and finally I have come up against something that I can't find an answer to. 

 

I would like to create a table that has data buckets on the left side and across the top. I would like to be able to count the number of employees that fall into the combination of the two groups. Specifically I want to know how employees have used 'special PTO' and 'regular PTO'. I have set up data buckets in seperate tables for each 'special PTO' and 'regular PTO'. 

 

I have successfully counted the number of employees in each bucket/PTO type using the following measures:

 

Number of Associates in Regular PTO Groupings = IF(HASONEVALUE('Regular PTO Buckets'[MinRangeValue]),COUNTROWS(FILTER('Time-Off Bank Report', 'Time-Off Bank Report'[PTO Sum] >= VALUES('Regular PTO Buckets'[MinRangeValue]) && [PTO Sum] < VALUES('Regular PTO Buckets'[MaxRangeValue]))),COUNTROWS('Time-Off Bank Report'))
 
&
 
Number of Associates in Special PTO Groupings = IF(HASONEVALUE('Special PTO Buckets'[MinRangeValue]),COUNTROWS(FILTER('Time-Off Bank Report', 'Time-Off Bank Report'[Special PTO Sum] >= VALUES('Special PTO Buckets'[MinRangeValue]) && [Special PTO Sum] < VALUES('Special PTO Buckets'[MaxRangeValue]))),COUNTROWS('Time-Off Bank Report'))
 

 Both Regular and Special PTO currently have the same buckets, but that may change in the future. Below is a sample of the table setup. 

 

Special PTO Buckets  MinRangeValue  MaxRangeValue

<10010
10-191020
20-292030
30-393040
404099999
 
I'm struggling to come up with a way to have a single measure determine which combination of buckets an employee is in. For example if an employee has 25 hours of 'special PTO' and 9 hours of 'regular PTO', I want them to show up on the matrix where '20-29' and '<10' intersect.
 
 
1 REPLY 1
Cristian_Angyal
Advocate III
Advocate III

Hi @Anonymous ,

 

There is a recent series of articles by Reza Rad on www.radacad.com that might help you.

Check out this blogpost: https://radacad.com/age-banding-in-power-bi-using-treatas-dax-function-relationship-based-on-between

 

 

If you liked my solution please give it a thumbs up 👍

If I did answer your question please mark my post as a solution .

Thank you !

 

 

Cristian

 

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.

Top Solution Authors