<?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: Filtering out multiple values for division calculation. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773687#M86467</link>
    <description>&lt;P&gt;Thank you! The top one works perfectly.&amp;nbsp; I'm using it in a line chart to compare the percentage of cats to dogs over time.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 13:33:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-16T13:33:50Z</dc:date>
    <item>
      <title>Filtering out multiple values for division calculation.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773585#M86457</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to do the caluation (Cat) / (Cat + Dog) from a column. But I have two other metrics I don't want to include in the calauation (Mouse &amp;amp; Rabbit), and would would like to filter out.&lt;/P&gt;&lt;P&gt;The [NoPet] measure is a count of all the pets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code but it is not working.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Pets C/D = &lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&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;[NoPet]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Animals'&lt;/SPAN&gt;&lt;SPAN&gt;[Pets]&lt;/SPAN&gt;&lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;"Cat"&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;[NoPet]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;('Animals'&lt;/SPAN&gt;&lt;SPAN&gt;,'Animals'[Pets]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;lt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;"Mouse"&lt;/SPAN&gt;&lt;SPAN&gt; || 'Animals'[Pets]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;lt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;"Rabbit"&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Could you please suggest workable and efficent way of doing this caluation?&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:02:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773585#M86457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-16T13:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out multiple values for division calculation.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773644#M86462</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure what visualization you want to present the result, but please try something like,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pets C/D =
DIVIDE (
    CALCULATE ( [NoPet], 'Animals'[Pets] IN { "Cat" } ),
    CALCULATE ( [NoPet], 'Animals'[Pets] IN { "Cat", "Dog" } )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pets C/D =
DIVIDE (
    CALCULATE ( [NoPet], 'Animals'[Pets] IN { "Cat" } ),
    CALCULATE (
        [NoPet],
        FILTER ( 'Animals', 'Animals'[Pets] &amp;lt;&amp;gt; "Mouse" &amp;amp;&amp;amp; 'Animals'[Pets] &amp;lt;&amp;gt; "Rabbit" )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:19:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773644#M86462</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-09-16T13:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out multiple values for division calculation.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773648#M86463</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;
&lt;P&gt;Can you provice de DAX code of [NoPet].&lt;/P&gt;
&lt;P&gt;In the meantime you can try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pets C/D =
DIVIDE(
    CALCULATE( [NoPet], 'Animals'[Pets] = "Cat" ),
    CALCULATE( [NoPet], 'Animals'[Pets] IN { "Cat", "Dog" } )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Let me know if that helps!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:21:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773648#M86463</guid>
      <dc:creator>PabloDeheza</dc:creator>
      <dc:date>2022-09-16T13:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out multiple values for division calculation.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773687#M86467</link>
      <description>&lt;P&gt;Thank you! The top one works perfectly.&amp;nbsp; I'm using it in a line chart to compare the percentage of cats to dogs over time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:33:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-out-multiple-values-for-division-calculation/m-p/2773687#M86467</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-16T13:33:50Z</dc:date>
    </item>
  </channel>
</rss>

