<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Grouping Data into Two Different Buckets in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Data-into-Two-Different-Buckets/m-p/991786#M12346</link>
    <description>&lt;P&gt;Hello, I've frequently used other users questions and finally I have come up against something that I can't find an answer to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successfully counted the number of employees in each bucket/PTO type using the following measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;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] &amp;gt;= VALUES('Regular PTO Buckets'[MinRangeValue]) &amp;amp;&amp;amp; [PTO Sum] &amp;lt; VALUES('Regular PTO Buckets'[MaxRangeValue]))),COUNTROWS('Time-Off Bank Report'))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;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] &amp;gt;= VALUES('Special PTO Buckets'[MinRangeValue]) &amp;amp;&amp;amp; [Special PTO Sum] &amp;lt; VALUES('Special PTO Buckets'[MaxRangeValue]))),COUNTROWS('Time-Off Bank Report'))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Special PTO Buckets&amp;nbsp; MinRangeValue&amp;nbsp; MaxRangeValue&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;lt;10&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10-19&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20-29&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30-39&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;99999&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;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 '&amp;lt;10' intersect.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 25 Mar 2020 20:57:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-25T20:57:08Z</dc:date>
    <item>
      <title>Grouping Data into Two Different Buckets</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Data-into-Two-Different-Buckets/m-p/991786#M12346</link>
      <description>&lt;P&gt;Hello, I've frequently used other users questions and finally I have come up against something that I can't find an answer to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successfully counted the number of employees in each bucket/PTO type using the following measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;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] &amp;gt;= VALUES('Regular PTO Buckets'[MinRangeValue]) &amp;amp;&amp;amp; [PTO Sum] &amp;lt; VALUES('Regular PTO Buckets'[MaxRangeValue]))),COUNTROWS('Time-Off Bank Report'))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;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] &amp;gt;= VALUES('Special PTO Buckets'[MinRangeValue]) &amp;amp;&amp;amp; [Special PTO Sum] &amp;lt; VALUES('Special PTO Buckets'[MaxRangeValue]))),COUNTROWS('Time-Off Bank Report'))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Special PTO Buckets&amp;nbsp; MinRangeValue&amp;nbsp; MaxRangeValue&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;lt;10&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10-19&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20-29&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30-39&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;99999&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;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 '&amp;lt;10' intersect.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Mar 2020 20:57:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Data-into-Two-Different-Buckets/m-p/991786#M12346</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-25T20:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Data into Two Different Buckets</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Data-into-Two-Different-Buckets/m-p/992641#M12370</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a recent series of articles by Reza Rad on &lt;A href="http://www.radacad.com" target="_blank"&gt;www.radacad.com&lt;/A&gt; that might help you.&lt;/P&gt;&lt;P&gt;Check out this blogpost:&amp;nbsp;&lt;A href="https://radacad.com/age-banding-in-power-bi-using-treatas-dax-function-relationship-based-on-between" target="_blank"&gt;https://radacad.com/age-banding-in-power-bi-using-treatas-dax-function-relationship-based-on-between&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If you liked my solution please give it a thumbs up &lt;/STRONG&gt;&lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If I did answer your question please mark my post as a solution &lt;/STRONG&gt;&lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt;. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you !&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cristian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 07:20:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Data-into-Two-Different-Buckets/m-p/992641#M12370</guid>
      <dc:creator>Cristian_Angyal</dc:creator>
      <dc:date>2020-03-26T07:20:28Z</dc:date>
    </item>
  </channel>
</rss>

