<?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: Using Slicer selected value to change which relationship is active in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2669696#M79552</link>
    <description>&lt;P&gt;Currently my DAX looks like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BrandSlicer = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt; &lt;SPAN&gt;_tab&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;BrandNameList[BrandNames]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;BrandNameList[BrandNames]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;BrandNames&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;BrandNames[AUDI]&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;_Tab&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;BrandNames[VW]&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;_tab&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;BrandNames[SBA]&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;_tab&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;BrandNames[CUPRA]&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;_tab&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;BrandNames[SKODA]&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;_tab&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;But I am unsure what to put as the Table after SUM(&lt;BR /&gt;because if I use it the way I wrote and put the measure as a filter on a visual it does not work.&lt;BR /&gt;&lt;EM&gt;(I have also removed all the relationships prior to doing this)&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2022 14:12:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-29T14:12:52Z</dc:date>
    <item>
      <title>Using Slicer selected value to change which relationship is active</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2669341#M79525</link>
      <description>&lt;P&gt;I currently have a table where a cell (Title) can contain multiple Brand values, so I made for each Brand a check to see if it is contained in that Title - visible under the BrandNames table, if yes then it will return the name of the brand.&lt;BR /&gt;Then I used the Distinct function in the BrandNameList table to get all unique brand names.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Now I want to have this slicer (which is the values from the BrandNameList) to filter the BrandNames table.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The Relationship works for 1 column in the BrandNames table as it is active, in this case "AUDI", but it does not work for the other brands since their relationship is inactive.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I have the slicer filter all the values based on what brands are found in the title using the USERELATIONSHIP() DAX function or a complete other way?&lt;/P&gt;&lt;P&gt;(The main issue is that 1 cell can contain multiple brands)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked up how to do this but found nothing, please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 11:16:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2669341#M79525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-29T11:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using Slicer selected value to change which relationship is active</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2669452#M79535</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Do not join or make all inactive &lt;/P&gt;
&lt;P&gt;measure =&lt;/P&gt;
&lt;P&gt;Var _tab = values(Slicer[Brand])&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;calculate(Sum(Table[Value]), filter(Table, Table[Brand 1] in Tab &amp;amp;&amp;amp; Table1[Brand 2] in _tab))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add more, use OR (||) if needed&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 12:09:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2669452#M79535</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-07-29T12:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using Slicer selected value to change which relationship is active</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2669696#M79552</link>
      <description>&lt;P&gt;Currently my DAX looks like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BrandSlicer = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt; &lt;SPAN&gt;_tab&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;BrandNameList[BrandNames]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&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_tab&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;BrandNames[SKODA]&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;_tab&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;But I am unsure what to put as the Table after SUM(&lt;BR /&gt;because if I use it the way I wrote and put the measure as a filter on a visual it does not work.&lt;BR /&gt;&lt;EM&gt;(I have also removed all the relationships prior to doing this)&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 14:12:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2669696#M79552</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-29T14:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Slicer selected value to change which relationship is active</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2677363#M80048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to add the measure into filter, you may try this code to create a measure. I suggest you to change all relationships between two tables to inactive.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;BrandSlicer =
VAR _tab =
    VALUES ( BrandNameList[BrandNames] )
RETURN
    IF (
        MAX ( BrandNames[AUDI] )
            IN _tab
                || MAX ( BrandNames[VW] )
                    IN _tab
                        || MAX ( BrandNames[SBA] )
                            IN _tab
                                || MAX ( BrandNames[CUPRA] )
                                    IN _tab
                                        || MAX ( BrandNames[SKODA] ) IN _tab,
        1,
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;Then add this measure into the visual level filter in your visual and set it to show items when value =1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 06:23:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Slicer-selected-value-to-change-which-relationship-is/m-p/2677363#M80048</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-03T06:23:49Z</dc:date>
    </item>
  </channel>
</rss>

