<?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: Measure to subtract a count when two filters applied in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3547228#M136415</link>
    <description>&lt;P&gt;Thank you for your hard work on this. The measure you proposed is much larger than what I would have ever thought. I believed it would be something like a measure to count the names once a sport was selected, then another measure to count the identical names once the 2nd filter is selected, and subtract those duplicates. Apparently i have a lot to learn regarding measures.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where I am working I am unable to provide sample data at this time. I will post the sample data in a few hours.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2023 17:01:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-11-22T17:01:38Z</dc:date>
    <item>
      <title>Measure to subtract a count when two filters applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3545673#M136327</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to create a measure in Power BI which when used with two filters, identifies the number of times both filters are selected for one object, and then removes this number from the overall count.&amp;nbsp;Let me explain with my example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a group of people who play 3 sports (Baseball, Boxing and Soccer). I need to create a filter so that I can select one sport (eg Baseball - 128 people play baseball), and then have a 2nd filter which Identifies another sport (eg Boxing - 64 people box).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure I need to create identifies the people who do both sports (eg People who Both play baseball and Box - only 22) and subtracts this number from the first filter (eg Baseball - 128 People). The result would be personnel who play baseball but do not box (final result 106).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to Power Bi and I believe a measure is the method to use, but I have no idea how to do this. Please help.&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>Tue, 21 Nov 2023 22:34:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3545673#M136327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-21T22:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to subtract a count when two filters applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3546126#M136346</link>
      <description>&lt;P&gt;Hi, DAX23&lt;/P&gt;
&lt;P&gt;May I ask if this is the expected output you are looking for? Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Measures:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count_baseball_boxing = CALCULATE(COUNTROWS('Table'),'Table'[BASEBALL]&amp;gt;0&amp;amp;&amp;amp;'Table'[BOXING]&amp;gt;0)

Count_baseball_soccer = CALCULATE(COUNTROWS('Table'),'Table'[BASEBALL]&amp;gt;0&amp;amp;&amp;amp;'Table'[SOCCER]&amp;gt;0)

Count_boxing_soccer = CALCULATE(COUNTROWS('Table'),'Table'[BOXING]&amp;gt;0&amp;amp;&amp;amp;'Table'[SOCCER]&amp;gt;0)

Diff_baseball_boxing = SUM('Table'[BASEBALL])-[Count_baseball_boxing]

Diff_baseball_soccer = SUM('Table'[BASEBALL])-[Count_baseball_soccer]

Diff_boxing_baseball = SUM('Table'[BOXING])-[Count_baseball_boxing]

Diff_boxing_soccer = SUM('Table'[BOXING])-[Count_boxing_soccer]

Diff_soccer_baseball = SUM('Table'[SOCCER])-[Count_baseball_soccer]

Diff_soccer_boxing = SUM('Table'[SOCCER])-[Count_boxing_soccer]

Filter = IF(SELECTEDVALUE('Sports1'[Sport])=MAX('Sports2'[Sport]),1)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure =

VAR _sport1 = SELECTEDVALUE('Sports1'[Sport])

VAR _sport2 = SELECTEDVALUE('Sports2'[Sport])

VAR _result =

SWITCH(

    TRUE(),

    ISBLANK(_sport1) || ISBLANK(_sport2),"Please selcet the sports",

    _sport1=_sport2,0,

    _sport1="Baseball" &amp;amp;&amp;amp; _sport2="Boxing",[Diff_baseball_boxing],

    _sport1="Baseball" &amp;amp;&amp;amp; _sport2="Soccer",[Diff_baseball_soccer],

    _sport1="Boxing" &amp;amp;&amp;amp; _sport2="Soccer",[Diff_boxing_soccer],

    _sport1="Boxing" &amp;amp;&amp;amp; _sport2="Baseball",[Diff_boxing_baseball],

    _sport1="Soccer" &amp;amp;&amp;amp; _sport2="Baseball",[Diff_soccer_baseball],

    _sport1="Soccer" &amp;amp;&amp;amp; _sport2="Boxing",[Diff_soccer_boxing]

)

RETURN

_result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not work, could you please share some sample data without sensitive information and expected output.&lt;BR /&gt;&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;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to get your questions answered quickly&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 06:42:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3546126#M136346</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-22T06:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to subtract a count when two filters applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3547228#M136415</link>
      <description>&lt;P&gt;Thank you for your hard work on this. The measure you proposed is much larger than what I would have ever thought. I believed it would be something like a measure to count the names once a sport was selected, then another measure to count the identical names once the 2nd filter is selected, and subtract those duplicates. Apparently i have a lot to learn regarding measures.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where I am working I am unable to provide sample data at this time. I will post the sample data in a few hours.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 17:01:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3547228#M136415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-22T17:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to subtract a count when two filters applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3579212#M138032</link>
      <description>&lt;H3&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/H3&gt;
&lt;P&gt;Have you solved this issue or any updates? If the above method did not solve your issue, you can provide sample data through the following.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt; You can post data tables (that do not contain sensitive information and cover the question), measures, and expected outputs in the Reply.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;The other option is to put your files in a dropbox, onedrive or googledrive folder and share the link with the community.&lt;/LI&gt;
&lt;LI&gt;Please refer to the related links for details:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;&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;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&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;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7Cce16d19809414d9f960208dbf1755128%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638369258411601530%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=oBisEpJnsk4p%2BcSV0F8sZ%2BFQHR%2FRvYA8sUWZIEcjQ4o%3D&amp;amp;reserved=0" target="_blank"&gt;How to get your questions answered quickly&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7Cce16d19809414d9f960208dbf1755128%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638369258411609718%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=sCaEt5xd5uTLXCby0%2B1XhR9V7RXxZLDCF088%2F9u%2FOUU%3D&amp;amp;reserved=0" target="_blank"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 07:56:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-subtract-a-count-when-two-filters-applied/m-p/3579212#M138032</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-12T07:56:24Z</dc:date>
    </item>
  </channel>
</rss>

