<?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 Need help on how to filter and divide column for a percentage in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3694723#M143661</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Normally when I do a table for a percentage I use the following formula to get a percentage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;measure=&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;'Q2'&lt;/SPAN&gt;&lt;SPAN&gt;[Black.Vancover]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&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;'Q2[Black.Vancover&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;()))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example table is below:&lt;/P&gt;&lt;P&gt;Table would be called for this example Q2&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID Marker&lt;/TD&gt;&lt;TD&gt;Do you like milk?&lt;/TD&gt;&lt;TD&gt;Black.Vancover&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10564&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1687&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10006&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6804&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This table is created by merging two tables together using the unique ID Marker. In the example respondants who were Black and in Vancover was merged with the table with the question and answers. This allows me to make measures with the formula above to get a percentage to use in graphs. I compare the different groups together by making seperate tables and the relationship between them is the answers. (I make a seperate table ex below, that has a relationship with the different tables for the different groups I am comparing in a graph)&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Order&lt;/TD&gt;&lt;TD&gt;Answer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now my problem is I have a question that I need to graph that is essential 4 questions being asked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The example below only is showing two questions, but what I am trying to do, is somehow in a measure filter the information so I am only getting a percentage for the question "Do you like milk", instead of a percentage for both "Do you like milk" and "Do you like cheese?"&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;ID Marker&lt;/TD&gt;&lt;TD&gt;Question&lt;/TD&gt;&lt;TD&gt;Answer&lt;/TD&gt;&lt;TD&gt;Black.Vancover&lt;/TD&gt;&lt;TD&gt;South Asian.Vancover&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;Do you like milk?&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;Do you like cheese?&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;102&lt;/TD&gt;&lt;TD&gt;Do you like cheese?&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;103&lt;/TD&gt;&lt;TD&gt;Do you like cheese?&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;104&lt;/TD&gt;&lt;TD&gt;Do you like milk?&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does anyone know a solution to this problem? I cannot figure out the filter function with this formula.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 13 Feb 2024 06:22:48 GMT</pubDate>
    <dc:creator>NewLearner555</dc:creator>
    <dc:date>2024-02-13T06:22:48Z</dc:date>
    <item>
      <title>Need help on how to filter and divide column for a percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3694723#M143661</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Normally when I do a table for a percentage I use the following formula to get a percentage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;measure=&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;'Q2'&lt;/SPAN&gt;&lt;SPAN&gt;[Black.Vancover]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&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;'Q2[Black.Vancover&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;()))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example table is below:&lt;/P&gt;&lt;P&gt;Table would be called for this example Q2&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID Marker&lt;/TD&gt;&lt;TD&gt;Do you like milk?&lt;/TD&gt;&lt;TD&gt;Black.Vancover&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10564&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1687&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10006&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6804&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This table is created by merging two tables together using the unique ID Marker. In the example respondants who were Black and in Vancover was merged with the table with the question and answers. This allows me to make measures with the formula above to get a percentage to use in graphs. I compare the different groups together by making seperate tables and the relationship between them is the answers. (I make a seperate table ex below, that has a relationship with the different tables for the different groups I am comparing in a graph)&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Order&lt;/TD&gt;&lt;TD&gt;Answer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now my problem is I have a question that I need to graph that is essential 4 questions being asked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The example below only is showing two questions, but what I am trying to do, is somehow in a measure filter the information so I am only getting a percentage for the question "Do you like milk", instead of a percentage for both "Do you like milk" and "Do you like cheese?"&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;ID Marker&lt;/TD&gt;&lt;TD&gt;Question&lt;/TD&gt;&lt;TD&gt;Answer&lt;/TD&gt;&lt;TD&gt;Black.Vancover&lt;/TD&gt;&lt;TD&gt;South Asian.Vancover&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;Do you like milk?&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;Do you like cheese?&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;102&lt;/TD&gt;&lt;TD&gt;Do you like cheese?&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;103&lt;/TD&gt;&lt;TD&gt;Do you like cheese?&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;104&lt;/TD&gt;&lt;TD&gt;Do you like milk?&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does anyone know a solution to this problem? I cannot figure out the filter function with this formula.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Feb 2024 06:22:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3694723#M143661</guid>
      <dc:creator>NewLearner555</dc:creator>
      <dc:date>2024-02-13T06:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on how to filter and divide column for a percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3695087#M143687</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 01:07:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3695087#M143687</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-13T01:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on how to filter and divide column for a percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3695320#M143695</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="689121" data-lia-user-login="NewLearner555" class="lia-mention lia-mention-user"&gt;NewLearner555&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've known your issue, maybe you can try filter function:&lt;/P&gt;
&lt;P&gt;I create a set of sample data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a calculate column:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = IF(
        'Table (2)'[week]=1,
        CALCULATE(
            COUNTROWS('Table (2)'),
            FILTER(
                ALLSELECTED('Table (2)'),
                'Table (2)'[week]=1
            )
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SUP&gt;Best Regards,&lt;/SUP&gt;&lt;/P&gt;
&lt;P&gt;&lt;SUP&gt;Zhengdong Xu&lt;/SUP&gt;&lt;/P&gt;
&lt;P&gt;&lt;SUP&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/SUP&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 03:58:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3695320#M143695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-13T03:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on how to filter and divide column for a percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3695529#M143710</link>
      <description>&lt;P&gt;I changed the information in the screenshot I provided so there was no sensitive data, but I've fixed the post like in the link you provided and hopefully made the problem more clear.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 06:24:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3695529#M143710</guid>
      <dc:creator>NewLearner555</dc:creator>
      <dc:date>2024-02-13T06:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on how to filter and divide column for a percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3695551#M143712</link>
      <description>&lt;P&gt;When I tried this calculation but it returns as an error. The If statement is asking for a measure instead of the columns in my table.&lt;/P&gt;&lt;DIV&gt;I did edit my question and made some example tables.&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Feb 2024 06:37:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3695551#M143712</guid>
      <dc:creator>NewLearner555</dc:creator>
      <dc:date>2024-02-13T06:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on how to filter and divide column for a percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3697359#M143780</link>
      <description>&lt;P&gt;Please provide sample data &lt;STRONG&gt;that fully covers your issue&lt;/STRONG&gt;.&lt;BR /&gt;Please show the expected outcome based on the sample data you provided.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 22:02:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-how-to-filter-and-divide-column-for-a-percentage/m-p/3697359#M143780</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-13T22:02:49Z</dc:date>
    </item>
  </channel>
</rss>

