<?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: Create new table with percent of respondents for each category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3687675#M143252</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="686930" data-lia-user-login="klontok" class="lia-mention lia-mention-user"&gt;klontok&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to create a calculation table, I have made a modification on the formula you provided, refer below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table_ = 
SUMMARIZE(
    'Infections Prior to Diagnosis',
    'Infections Prior to Diagnosis'[Infection],
    "Percent of respondents",
    DIVIDE(
        CALCULATE (
            COUNTROWS('Infections Prior to Diagnosis'),
            FILTER(
                ALL('Infections Prior to Diagnosis'),
                'Infections Prior to Diagnosis'[Infection] = VALUES('Infections Prior to Diagnosis'[Infection])
            )
        ),
        CALCULATE(
            DISTINCTCOUNT('Infections Prior to Diagnosis'[Survey ID]),
            ALL('Infections Prior to Diagnosis')
        )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2024 08:23:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-02-08T08:23:04Z</dc:date>
    <item>
      <title>Create new table with percent of respondents for each category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3686192#M143183</link>
      <description>&lt;P&gt;I have an unpivoted table of survey data where respondents could choose more than one of several options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Survey ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Infection&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Response&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0001&lt;/TD&gt;&lt;TD&gt;Sinusitis&lt;/TD&gt;&lt;TD&gt;Selected&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0001&lt;/TD&gt;&lt;TD&gt;Sepsis&lt;/TD&gt;&lt;TD&gt;Selected&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0002&lt;/TD&gt;&lt;TD&gt;Pneumonia&lt;/TD&gt;&lt;TD&gt;Selected&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0003&lt;/TD&gt;&lt;TD&gt;Sepsis&lt;/TD&gt;&lt;TD&gt;Selected&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0003&lt;/TD&gt;&lt;TD&gt;Pneumonia&lt;/TD&gt;&lt;TD&gt;Selected&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a table that shows the percent of respondents that chose each infection.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Infection&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;% of respondents&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sinusitis&lt;/TD&gt;&lt;TD&gt;33%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sepsis&lt;/TD&gt;&lt;TD&gt;66%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Pneumonia&lt;/TD&gt;&lt;TD&gt;66%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using SUMMARIZE, but I can't seem to get the correct denominator. The COUNTDISTINCT below counts only the distinct Survey IDs within the infection category instead of in the entire table, so I get 100% for every type of infection. Maybe SUMMARIZE is the wrong way to go? Thanks in advance for any help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Table =&lt;/SPAN&gt; &lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Infections Prior to Diagnosis'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Infections Prior to Diagnosis'&lt;/SPAN&gt;&lt;SPAN&gt;[Infections]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"Percent of respondents"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Infections Prior to Diagnosis'&lt;/SPAN&gt;&lt;SPAN&gt;[Response]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;COUNTDISTINCT('Infections Prior to Diagnosis'[Survey ID]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Feb 2024 15:49:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3686192#M143183</guid>
      <dc:creator>klontok</dc:creator>
      <dc:date>2024-02-07T15:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create new table with percent of respondents for each category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3686945#M143222</link>
      <description>&lt;P&gt;This question is much more complex than you might think, but here is a simplistic approach that takes some liberties.&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;</description>
      <pubDate>Thu, 08 Feb 2024 00:01:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3686945#M143222</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-08T00:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create new table with percent of respondents for each category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3687675#M143252</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="686930" data-lia-user-login="klontok" class="lia-mention lia-mention-user"&gt;klontok&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to create a calculation table, I have made a modification on the formula you provided, refer below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table_ = 
SUMMARIZE(
    'Infections Prior to Diagnosis',
    'Infections Prior to Diagnosis'[Infection],
    "Percent of respondents",
    DIVIDE(
        CALCULATE (
            COUNTROWS('Infections Prior to Diagnosis'),
            FILTER(
                ALL('Infections Prior to Diagnosis'),
                'Infections Prior to Diagnosis'[Infection] = VALUES('Infections Prior to Diagnosis'[Infection])
            )
        ),
        CALCULATE(
            DISTINCTCOUNT('Infections Prior to Diagnosis'[Survey ID]),
            ALL('Infections Prior to Diagnosis')
        )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 08:23:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3687675#M143252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-08T08:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create new table with percent of respondents for each category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3689045#M143340</link>
      <description>&lt;P&gt;Thank you so much! I was assuming I had to create another table, but the measure actually works better for my purposes because the slicers filter it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 17:54:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-new-table-with-percent-of-respondents-for-each-category/m-p/3689045#M143340</guid>
      <dc:creator>klontok</dc:creator>
      <dc:date>2024-02-08T17:54:24Z</dc:date>
    </item>
  </channel>
</rss>

