<?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: Dax formula to filter table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327580#M124628</link>
    <description>&lt;P&gt;ok it looks like you are using 1 table since european country is under countries powerbi cant tell which country is inside the eu, you need to maybe add a new column that says which countries are part of the eu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2023 14:13:13 GMT</pubDate>
    <dc:creator>eliasayyy</dc:creator>
    <dc:date>2023-07-12T14:13:13Z</dc:date>
    <item>
      <title>Dax formula to filter table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327235#M124601</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have text data visualised in a table in Powe bi. European Union is also available in data as a country. Requirement is to custom filter table in a way that if user select any EU country from slicer, table should show selected country + EU. In case non-EU country is selected, table should only show selected country.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a new table, not related to data model with list of countries and created below measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filter=If(selectedvalue(fact_table[country])="European Union"||Selectedvalue(facr_table[country] in values(unrelated_table[country]),1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have applied this measure as visual filter to table visualisation and set it's value to 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's partially working and showing European Union when I select an EU country or non-EU country from slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help me to modify this calculation so it only shows European Union when an EU country is selected.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 11:42:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327235#M124601</guid>
      <dc:creator>Ughd</dc:creator>
      <dc:date>2023-07-12T11:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to filter table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327247#M124605</link>
      <description>&lt;P&gt;you need to show us the tables please&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 11:53:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327247#M124605</guid>
      <dc:creator>eliasayyy</dc:creator>
      <dc:date>2023-07-12T11:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to filter table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327280#M124609</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are the screen shots. Fact table is very simple with 4 fields, country, doc name, description, contact person.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 12:08:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327280#M124609</guid>
      <dc:creator>Ughd</dc:creator>
      <dc:date>2023-07-12T12:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to filter table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327580#M124628</link>
      <description>&lt;P&gt;ok it looks like you are using 1 table since european country is under countries powerbi cant tell which country is inside the eu, you need to maybe add a new column that says which countries are part of the eu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 14:13:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3327580#M124628</guid>
      <dc:creator>eliasayyy</dc:creator>
      <dc:date>2023-07-12T14:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to filter table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3330992#M124821</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="588020" data-lia-user-login="Ughd" class="lia-mention lia-mention-user"&gt;Ughd&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please try below steps:&lt;/P&gt;
&lt;P&gt;1. below is my test table&lt;/P&gt;
&lt;P&gt;Table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Table2:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. create a measure with below dax formula&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR a =
    SELECTEDVALUE ( 'Table 2'[Country] )
VAR b =
    CALCULATE (
        MAX ( 'Table 2'[Is European Union Country] ),
        'Table 2'[Country] = a
    )
VAR cur_country =
    SELECTEDVALUE ( 'Table'[Country] )
VAR val =
    SWITCH (
        TRUE (),
        b = "Yes",
            IF ( cur_country = a || cur_country = "Europen Union", 1 ),
        b = "No", IF ( cur_country = a, 1 )
    )
RETURN
    IF ( NOT ( HASONEVALUE ( 'Table 2'[Country] ) ), 1, val )
&lt;/LI-CODE&gt;
&lt;P&gt;3. add a table visual with Table fields, add a slicer with Table2 field, add measure to table visual filter pane and set&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;Please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_Binbin Yu&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&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;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 09:01:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3330992#M124821</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-14T09:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to filter table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3334038#M125014</link>
      <description>&lt;P&gt;Hi&amp;nbsp;v-binbinyu-msft,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's working perfectly but users also want option to select multiple countries. Is it possible with this calculation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 09:56:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3334038#M125014</guid>
      <dc:creator>Ughd</dc:creator>
      <dc:date>2023-07-17T09:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to filter table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3335437#M125079</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="588020" data-lia-user-login="Ughd" class="lia-mention lia-mention-user"&gt;Ughd&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please replace before dax formula with below dax formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR a =
    SELECTCOLUMNS ( 'Table 2', "CT", [Country] )
VAR str =
    CONCATENATEX ( a, [CT] )
VAR b =
    CALCULATETABLE (
        VALUES ( 'Table 2'[Is European Union Country] ),
        FILTER ( ALL ( 'Table 2' ), CONTAINSSTRING ( str, 'Table 2'[Country] ) )
    )
VAR str2 =
    CONCATENATEX ( b, [Is European Union Country] )
VAR cur_country =
    SELECTEDVALUE ( 'Table'[Country] )
VAR val =
    SWITCH (
        TRUE (),
        CONTAINSSTRING ( str2, "Yes" ),
            IF ( CONTAINSSTRING ( str, cur_country ) || cur_country = "Europen Union", 1 ),
        NOT ( CONTAINSSTRING ( str2, "Yes" ) ), IF ( CONTAINSSTRING ( str, cur_country ), 1 )
    )
RETURN
    IF ( NOT ( ISFILTERED ( 'Table 2'[Country] ) ), 1, val )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_Binbin Yu&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&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;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 01:54:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3335437#M125079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-18T01:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to filter table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3335709#M125093</link>
      <description>&lt;P&gt;if you see his video then you can see he seelected multiple countries so it should work&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 06:20:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-filter-table/m-p/3335709#M125093</guid>
      <dc:creator>eliasayyy</dc:creator>
      <dc:date>2023-07-18T06:20:11Z</dc:date>
    </item>
  </channel>
</rss>

