<?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: DAX Formula to group categories in One column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3272493#M121344</link>
    <description>&lt;P&gt;Excellent.&amp;nbsp; I will try this out.&amp;nbsp; Thanks so much.&amp;nbsp; Get back when I work it out on my end.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2023 11:26:38 GMT</pubDate>
    <dc:creator>common763</dc:creator>
    <dc:date>2023-06-07T11:26:38Z</dc:date>
    <item>
      <title>DAX Formula to group categories in One column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3227671#M118267</link>
      <description>&lt;P&gt;I have an issue and trying to figure it out.&amp;nbsp; I have two columns that need to somehow be assessed and it isnt working for me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column A is an ID column that has 1000's of unique IDS.&lt;/P&gt;&lt;P&gt;Column B has specific categories&amp;nbsp;&lt;/P&gt;&lt;P&gt;Business Rules: When a category is selected, the end-user wants to know what the % of that category is alongside the % of all other categories that shared that ID.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end-user wants to do some predicitive analysis and asked that we show them what % of each category.&amp;nbsp; So in the below scenario, if someone selected DEF in a slicer,&amp;nbsp; a pie chart would show DEF as 50% (2) and EFG as 50% (2).&amp;nbsp; Basically if DEF is selected, what is the percentage of all other categories in that column sharing the same ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Data&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CATEGORY&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ABC&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DEF&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EFG&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DEF&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EFG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant use ID as a slicer because there are 1000's and it just doesnt work.&amp;nbsp; &amp;nbsp;Was wondering if someone can get me in the right direction for some type of DAX formula or alteration of the data set to get this functioning.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 18:25:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3227671#M118267</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2023-05-09T18:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Formula to group categories in One column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3228768#M118386</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="214200" data-lia-user-login="common763" class="lia-mention lia-mention-user"&gt;common763&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have correctly understood your task, you need a measure like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In text format for convenience:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
VAR Num = COUNT ( data[ID] )
VAR IDSet = VALUES ( data[ID] )
VAR Denom = COUNTX ( FILTER ( ALL ( data ), data[ID] IN IDSet ), [Category] )
RETURN DIVIDE ( Num, Denom )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 12:38:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3228768#M118386</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2023-05-10T12:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Formula to group categories in One column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3265829#M120890</link>
      <description>&lt;P&gt;Ok sorry for the late response.&amp;nbsp; Our team had a solution but it seems like a band aid.&amp;nbsp; This kind of gets me there but doesnt properly group based off the selection.&amp;nbsp; The customer wants to single select a category, so say the select ABC in a slicer.&amp;nbsp; They then want a pie graph to display the total for ABC and all other categories with the same ID.&amp;nbsp; &amp;nbsp; So with the below:&lt;/P&gt;&lt;P&gt;1-ABC&lt;/P&gt;&lt;P&gt;1-DDD&lt;/P&gt;&lt;P&gt;1-CCC&lt;/P&gt;&lt;P&gt;1-EEE&lt;/P&gt;&lt;P&gt;2-ABC&lt;/P&gt;&lt;P&gt;2-CCC&lt;/P&gt;&lt;P&gt;2-EEE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output would equal ABC = 2&amp;nbsp; DDD = 1 CCC = 2 EEE = 2 or by % of those numbers&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We ended up creating two replicated tables, then many to many relationships and it works in BI Desktop, but when I tried to redo it in Report Server I am getting errors and thinking there has to be a better way to handle this.&amp;nbsp; Any information would be greatly appreciated.&amp;nbsp; Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 14:17:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3265829#M120890</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2023-06-02T14:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Formula to group categories in One column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3272210#M121324</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="214200" data-lia-user-login="common763" class="lia-mention lia-mention-user"&gt;common763&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Okay, I've managed to build the pie chart you need with my toy data. Please try this approach with your production dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea is:&lt;/P&gt;&lt;P&gt;1) You create a new table with the unique values from the Category column.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cats = DISTINCT ( data[Category] )&lt;/LI-CODE&gt;&lt;P&gt;It should be standalone, not linked with the main table.&lt;/P&gt;&lt;P&gt;2) You create a measure like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Filtered Count = 
VAR SelectedValues = VALUES ( data[ID] )
VAR ActiveCategory = MIN ( Cats[Category] )
RETURN COUNTX ( FILTER ( ALL ( data ), AND ( data[ID] IN SelectedValues, data[Category] = ActiveCategory ) ), [Category] ) &lt;/LI-CODE&gt;&lt;P&gt;3) You add a Category slicer on your dashboard&amp;nbsp;&lt;STRONG&gt;based on the column of your main table&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;4) You add a Pie Chart visual and use Cats[Category] and the measure from p. 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Voila:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 08:45:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3272210#M121324</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2023-06-07T08:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Formula to group categories in One column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3272493#M121344</link>
      <description>&lt;P&gt;Excellent.&amp;nbsp; I will try this out.&amp;nbsp; Thanks so much.&amp;nbsp; Get back when I work it out on my end.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 11:26:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3272493#M121344</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2023-06-07T11:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Formula to group categories in One column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3272812#M121357</link>
      <description>&lt;P&gt;Excellent Job.&amp;nbsp; Works perfectly.&amp;nbsp; Thanks so much.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 13:44:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Formula-to-group-categories-in-One-column/m-p/3272812#M121357</guid>
      <dc:creator>common763</dc:creator>
      <dc:date>2023-06-07T13:44:27Z</dc:date>
    </item>
  </channel>
</rss>

