<?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 Re: How to Summarize Values Based on Count in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2681998#M80350</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17198" data-lia-user-login="littlemojopuppy" class="lia-mention lia-mention-user"&gt;littlemojopuppy&lt;/a&gt;&amp;nbsp;Yes I have, but the native function of binning and grouping doesn't work for my needs. Binning doesn't help with categorical values, such in my case, the Type. I am grouping together the Type&amp;nbsp;&lt;U&gt;based on&lt;/U&gt; the value of COUNT(ID).&lt;BR /&gt;&lt;BR /&gt;Sure, I could use the grouping function and manually select the types that need to be grouped, but that isn't very intuitive or efficient. I want a conditional grouping based on the decimal (%) value of COUNT(ID) against the grand total.&lt;BR /&gt;&lt;BR /&gt;E.g. Type A has 3 occurances, so the COUNT(ID) value will be 3. There are 10 rows, meaning 10 total occurances. So Type A would have a value of 30%, or 0.30.&lt;BR /&gt;&lt;BR /&gt;Type C has 1 occurance. So COUNT(ID) is 1. There are 10 total occurances in the table. So Type C would have a value of 10%, or 0.10. Based on my condition, if this value is below 0.20, it needs to be grouped into "Other".&lt;/P&gt;</description>
    <pubDate>Thu, 04 Aug 2022 14:17:26 GMT</pubDate>
    <dc:creator>DainTheTrain</dc:creator>
    <dc:date>2022-08-04T14:17:26Z</dc:date>
    <item>
      <title>How to Summarize Values Based on Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2679940#M80230</link>
      <description>&lt;P&gt;I have a data source with a list of ID's and a Type:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;222&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;333&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;444&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;555&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;666&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;777&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;888&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;999&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;000&lt;/TD&gt;&lt;TD&gt;G&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;I created a table visual in Power BI where I counted the instances of ID for each Type:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;COUNT(ID)&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;G&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;The next step I want to take is find the decimal of the COUNT(ID) against the grand total, and any decimal value that is below .2, will be combined into a type defined as "Other".&lt;BR /&gt;&lt;BR /&gt;So that means this table:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;COUNT(ID)&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;G&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would then turn into:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;COUNT(ID)&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;Other&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Because types C through G would have a value of .1, and thus would be combined into the defined type "Other".&lt;BR /&gt;&lt;BR /&gt;Please and thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 21:19:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2679940#M80230</guid>
      <dc:creator>DainTheTrain</dc:creator>
      <dc:date>2022-08-03T21:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Values Based on Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2680165#M80237</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="421381" data-lia-user-login="DainTheTrain" class="lia-mention lia-mention-user"&gt;DainTheTrain&lt;/a&gt;&amp;nbsp;have you looked at the &lt;A href="https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning" target="_self"&gt;Binning and Grouping features of Power BI&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 00:20:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2680165#M80237</guid>
      <dc:creator>littlemojopuppy</dc:creator>
      <dc:date>2022-08-04T00:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Values Based on Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2681998#M80350</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17198" data-lia-user-login="littlemojopuppy" class="lia-mention lia-mention-user"&gt;littlemojopuppy&lt;/a&gt;&amp;nbsp;Yes I have, but the native function of binning and grouping doesn't work for my needs. Binning doesn't help with categorical values, such in my case, the Type. I am grouping together the Type&amp;nbsp;&lt;U&gt;based on&lt;/U&gt; the value of COUNT(ID).&lt;BR /&gt;&lt;BR /&gt;Sure, I could use the grouping function and manually select the types that need to be grouped, but that isn't very intuitive or efficient. I want a conditional grouping based on the decimal (%) value of COUNT(ID) against the grand total.&lt;BR /&gt;&lt;BR /&gt;E.g. Type A has 3 occurances, so the COUNT(ID) value will be 3. There are 10 rows, meaning 10 total occurances. So Type A would have a value of 30%, or 0.30.&lt;BR /&gt;&lt;BR /&gt;Type C has 1 occurance. So COUNT(ID) is 1. There are 10 total occurances in the table. So Type C would have a value of 10%, or 0.10. Based on my condition, if this value is below 0.20, it needs to be grouped into "Other".&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 14:17:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2681998#M80350</guid>
      <dc:creator>DainTheTrain</dc:creator>
      <dc:date>2022-08-04T14:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Values Based on Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2687135#M80762</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="421381" data-lia-user-login="DainTheTrain" class="lia-mention lia-mention-user"&gt;DainTheTrain&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Type_Column =
var _count=COUNTX(FILTER(ALL('Table'),'Table'[Type]=EARLIER('Table'[Type])),[ID])
var _countall=COUNTROWS('Table')
var _value=
DIVIDE(
    _count,_countall)
return
IF(
    _value&amp;lt;0.2,"Other",[Type])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Place [Type_Column] and [ID]. and set [ID] – Count.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you need pbix, please click &lt;A href="https://m365x97431909-my.sharepoint.com/:u:/g/personal/ly_m365x97431909_onmicrosoft_com/EZ8RSf8RuDhEpHeJ4E9r73EB33cTcsDowwqCwZTmWQjJjQ?e=Ux8sFv" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 11:10:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Values-Based-on-Count/m-p/2687135#M80762</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-08T11:10:45Z</dc:date>
    </item>
  </channel>
</rss>

