<?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 a slicer's values based on the values of another table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3692231#M143502</link>
    <description>&lt;P&gt;Dear&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;Many thanks for your reply. But it dosen't work unfortunately.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have provided more details, also the pbix files, in the following two posts (I don't duplicate them here just to prevent overcrowding the topic).&lt;/P&gt;&lt;P&gt;I look forward to hearing your further suggestions!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Farhad&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;A href="https://drive.google.com/file/d/1T0s8K3zuSn5tN9wAAiey33_7f-r4_uKZ/view?usp=drive_link" target="_self"&gt;Dynamic Slicer.pbix&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;A href="https://drive.google.com/file/d/1472d9lXQzLpf5LC163ejh1HdpOjZqLoV/view?usp=drive_link" target="_self"&gt;Dynamic Slicer 2.pbix&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Feb 2024 09:56:00 GMT</pubDate>
    <dc:creator>Farhad88</dc:creator>
    <dc:date>2024-02-10T09:56:00Z</dc:date>
    <item>
      <title>Filtering a slicer's values based on the values of another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3678687#M142843</link>
      <description>&lt;P&gt;Hi everybody!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;My goal&lt;/STRONG&gt; is to filter the values of a slicer, based on the values selected from another table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem description:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have a slicer which shows the values of a dynamic parameter (named &lt;STRONG&gt;Y1-Axis Params&lt;/STRONG&gt;) as the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dynamic parameter (named &lt;STRONG&gt;Y1-Axis Params&lt;/STRONG&gt;) is defined as the following.&amp;nbsp; So, in the table view, you should see three columns as the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, I have another table (named: &lt;STRONG&gt;Table_Params_List&lt;/STRONG&gt;) which contains the Id and name of some parameters, as the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want to filter the slicer’s values based on the selected values from this table, so:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1- first I defined a measure to return the Id of the selected value:&lt;/P&gt;&lt;P&gt;Selected_ParamId = SELECTEDVALUE(Table_Params_List[Id],0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2- then, I used a custom column to save the Id of all selected values:&lt;/P&gt;&lt;P&gt;Selected_ParamIDs =&lt;/P&gt;&lt;P&gt;&amp;nbsp;var _selectedIDs= [Selected_ParamId]&lt;/P&gt;&lt;P&gt;&amp;nbsp;return&lt;/P&gt;&lt;P&gt;&amp;nbsp;_selectedIDs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far so good. Now Selected_ParamIDs shows the IDs of all selected rows from Table_Params_List:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Now, I want to filter the slicer’s values based on the values of this custom column. For this purpose:&lt;/P&gt;&lt;P&gt;I defined a new measure (named: Include?) as the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Include? =&lt;/P&gt;&lt;P&gt;var _selectedIDs= VALUES(Table_Params_List[Selected_ParamIDs])&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;IF(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; MAX('Y1-Axis Params'[Y=Axis Params Order]) in _selectedIDs,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1,&amp;nbsp; &amp;nbsp;0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then, I added this measure (using dag and drop) to the Filters pan of the slicer visual and configed it as the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As you can see, in this way, I could get the IDs of the selected items from the table, but the slicer still shows all of the values!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;** But, if I use a measure as the following, it works well and filters the values of the slicer!!&lt;/P&gt;&lt;P&gt;Include? =&lt;/P&gt;&lt;P&gt;IF(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; MAX('Y1-Axis Params'[Y=Axis Params Order]) &amp;gt;= 2 ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1,&amp;nbsp; &amp;nbsp;0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So why it doesn’t work when I try to use the variable _selectedIDs? (But it works if I use some fixed values for the comparison!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice is very appreciated!&lt;/P&gt;&lt;P&gt;Thanks and best regards!&lt;/P&gt;&lt;P&gt;Farhad&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 19:02:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3678687#M142843</guid>
      <dc:creator>Farhad88</dc:creator>
      <dc:date>2024-02-04T19:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a slicer's values based on the values of another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3679127#M142861</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="682515" data-lia-user-login="Farhad88" class="lia-mention lia-mention-user"&gt;Farhad88&lt;/a&gt; , measure seem good, Try this version and check for not blank &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;countrows(intersect( Values('Y1-Axis Params'[Y=Axis Params Order]),VALUES(Table_Params_List[Selected_ParamIDs])))&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 04:22:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3679127#M142861</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2024-02-05T04:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a slicer's values based on the values of another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3679565#M142876</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="682515" data-lia-user-login="Farhad88" class="lia-mention lia-mention-user"&gt;Farhad88&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you can create a new table that will be based on the selected values in the Table_Params_List&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;
&lt;LI-CODE lang="markup"&gt;Selected_Params =

CALCULATETABLE(

    FILTER(Table_Params_List,[Selected_ParamIDs]=1))

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Modify the measure Include? to use the newly created table to determine whether a value should be included in the slicer.&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;
&lt;LI-CODE lang="markup"&gt;Include? =

VAR _selectedParamOrder = MAX('Y1-Axis Params'[Y=Axis Params Order])

RETURN

IF(_selectedParamOrder IN VALUES(Selected_Params[Id]),1,0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apply the measure as a filter to the slicer.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&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%7C02%7Cv-yohua%40microsoft.com%7Cc5bd6d7746134c1f1f3e08dc261fd53a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638427165389016058%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=MoC4rOLAxapNtkX9xZmwzKXgzLwhezjcoXh6QCsZY50%3D&amp;amp;reserved=0" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Yongkang Hua&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 08:03:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3679565#M142876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-05T08:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a slicer's values based on the values of another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3680385#M142910</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;and&amp;nbsp;Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your suggections.&lt;/P&gt;&lt;P&gt;I tried them out, but they were not promising, unfortunately.&lt;/P&gt;&lt;P&gt;As I showed in the following screenshot, I can get the Id of the selected values from the table, but when I try to filter the slicer based on these IDs (using the "Include?" measure) it doesn't work:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I also attached the &lt;A href="https://drive.google.com/file/d/1T0s8K3zuSn5tN9wAAiey33_7f-r4_uKZ/view?usp=sharing" target="_blank" rel="noopener"&gt;Dynamic Slicer.pbix&lt;/A&gt; file for further investigations.&lt;/P&gt;&lt;P&gt;Thanks and best regards,&lt;/P&gt;&lt;P&gt;Farhad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 13:42:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3680385#M142910</guid>
      <dc:creator>Farhad88</dc:creator>
      <dc:date>2024-02-05T13:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a slicer's values based on the values of another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3682671#M143027</link>
      <description>&lt;P&gt;I noticed that if we convert the slicer to a table visual everything works well! (screenshot and pbix file attached)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, why the same code and settings work differently for slicer and table visuals?&lt;/P&gt;&lt;P&gt;And, more importantly, the same question remines:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How we can filter the slicer's values dynamically based on the selected values of another table?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;A href="https://drive.google.com/file/d/1472d9lXQzLpf5LC163ejh1HdpOjZqLoV/view?usp=sharing" target="_self"&gt;&lt;STRONG&gt;Dynamic Slicer 2.pbix&lt;/STRONG&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks for your advice!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 10:06:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3682671#M143027</guid>
      <dc:creator>Farhad88</dc:creator>
      <dc:date>2024-02-06T10:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a slicer's values based on the values of another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3686139#M143180</link>
      <description>&lt;P&gt;Dear Power BI experts,&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This issue is still open &lt;span class="lia-unicode-emoji" title=":expressionless_face:"&gt;😑&lt;/span&gt;. I have included the pbix file with the problem description in previous posts.&lt;/P&gt;&lt;P&gt;Any solution or suggestion is highly appreciated!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Farhad&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 15:19:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3686139#M143180</guid>
      <dc:creator>Farhad88</dc:creator>
      <dc:date>2024-02-07T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a slicer's values based on the values of another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3692231#M143502</link>
      <description>&lt;P&gt;Dear&amp;nbsp;Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Many thanks for your reply. But it dosen't work unfortunately.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have provided more details, also the pbix files, in the following two posts (I don't duplicate them here just to prevent overcrowding the topic).&lt;/P&gt;&lt;P&gt;I look forward to hearing your further suggestions!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Farhad&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;A href="https://drive.google.com/file/d/1T0s8K3zuSn5tN9wAAiey33_7f-r4_uKZ/view?usp=drive_link" target="_self"&gt;Dynamic Slicer.pbix&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;A href="https://drive.google.com/file/d/1472d9lXQzLpf5LC163ejh1HdpOjZqLoV/view?usp=drive_link" target="_self"&gt;Dynamic Slicer 2.pbix&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 09:56:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-slicer-s-values-based-on-the-values-of-another-table/m-p/3692231#M143502</guid>
      <dc:creator>Farhad88</dc:creator>
      <dc:date>2024-02-10T09:56:00Z</dc:date>
    </item>
  </channel>
</rss>

