<?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 Filter a table based on multiple conditions in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-multiple-conditions/m-p/2977357#M99717</link>
    <description>&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help writing this measure. Here is a sample data.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Plan&amp;nbsp; &amp;nbsp; &amp;nbsp; Year&amp;nbsp; &amp;nbsp; Amt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Plan 1&amp;nbsp; &amp;nbsp;2019&amp;nbsp; &amp;nbsp;30&lt;BR /&gt;Plan 1&amp;nbsp; &amp;nbsp;2020&amp;nbsp; &amp;nbsp;40&lt;BR /&gt;Plan 1&amp;nbsp; &amp;nbsp;2021&amp;nbsp; &amp;nbsp;15&lt;BR /&gt;Plan 2&amp;nbsp; &amp;nbsp;2015&amp;nbsp; &amp;nbsp;20&lt;BR /&gt;Plan 2&amp;nbsp; &amp;nbsp;2018&amp;nbsp; &amp;nbsp;20&lt;BR /&gt;Plan 2&amp;nbsp; &amp;nbsp;2020&amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;I want a DAX to return me 'Plan 1' with all the columns, as Plan 1 Year 2020 met the condition Amt &amp;gt; 35. The output should be like this,&amp;nbsp; How to do that?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Dec 2022 19:29:01 GMT</pubDate>
    <dc:creator>amit_msmba</dc:creator>
    <dc:date>2022-12-19T19:29:01Z</dc:date>
    <item>
      <title>Filter a table based on multiple conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-multiple-conditions/m-p/2977357#M99717</link>
      <description>&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help writing this measure. Here is a sample data.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Plan&amp;nbsp; &amp;nbsp; &amp;nbsp; Year&amp;nbsp; &amp;nbsp; Amt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Plan 1&amp;nbsp; &amp;nbsp;2019&amp;nbsp; &amp;nbsp;30&lt;BR /&gt;Plan 1&amp;nbsp; &amp;nbsp;2020&amp;nbsp; &amp;nbsp;40&lt;BR /&gt;Plan 1&amp;nbsp; &amp;nbsp;2021&amp;nbsp; &amp;nbsp;15&lt;BR /&gt;Plan 2&amp;nbsp; &amp;nbsp;2015&amp;nbsp; &amp;nbsp;20&lt;BR /&gt;Plan 2&amp;nbsp; &amp;nbsp;2018&amp;nbsp; &amp;nbsp;20&lt;BR /&gt;Plan 2&amp;nbsp; &amp;nbsp;2020&amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;I want a DAX to return me 'Plan 1' with all the columns, as Plan 1 Year 2020 met the condition Amt &amp;gt; 35. The output should be like this,&amp;nbsp; How to do that?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 19:29:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-multiple-conditions/m-p/2977357#M99717</guid>
      <dc:creator>amit_msmba</dc:creator>
      <dc:date>2022-12-19T19:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on multiple conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-multiple-conditions/m-p/2977538#M99723</link>
      <description>&lt;P&gt;The lazy way is to just use a visual-level filter and set Sum of Amt &amp;gt; 35.&lt;BR /&gt;If you need it in DAX, try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum of Amt = 
var sumOfAmt = SUM(Amt)
return IF(sumOfAmt &amp;gt; 35, sumOfAmt, BLANK())&lt;/LI-CODE&gt;&lt;P&gt;The BLANK() is optional, but it helps with readability in my opinion.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 21:38:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-multiple-conditions/m-p/2977538#M99723</guid>
      <dc:creator>vicky_</dc:creator>
      <dc:date>2022-12-19T21:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on multiple conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-multiple-conditions/m-p/2978157#M99769</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="487467" data-lia-user-login="amit_msmba" class="lia-mention lia-mention-user"&gt;amit_msmba&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created a sample pbix file(see &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;), please check if that is what you want. You can create the measures below to get it and apply a visual-level filter on your table visual with the condition(&lt;EM&gt;&lt;STRONG&gt;Flag is 1&lt;/STRONG&gt;&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum of Amt = SUM('Table'[Amt])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Flag = 
VAR _plan =
    SELECTEDVALUE ( 'Table'[Plan] )
VAR _tab =
    CALCULATETABLE (
        VALUES ( 'Table'[Plan] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Plan] = _plan &amp;amp;&amp;amp; [Sum of Amt] &amp;gt; 35 )
    )
RETURN
    IF ( _plan IN _tab, 1, 0 )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 06:30:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-multiple-conditions/m-p/2978157#M99769</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-20T06:30:05Z</dc:date>
    </item>
  </channel>
</rss>

