<?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 on two selected values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2706229#M82064</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; Thanks for your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do kinda follow where you are going, however, I got no idea what to put into the return section of the measure, as I would like to display a table with all the gameid? - I do not see how I can filter the data tabel based on _SharedGames varaible?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 12:36:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-08-17T12:36:50Z</dc:date>
    <item>
      <title>Filtering on two selected values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2703985#M81947</link>
      <description>&lt;P&gt;Hi, All!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do really not know if I am looking at this task from the right angel, so I am really hoping one of you can help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is, that I would like to select one team in the tabel to the left, then select an opponent in the slicer in the top right, and then get their matchhistory against eachother in the table to the right.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My initial thought was, that I needed to collect the selected value in the slicer, and then filter on whether both the selected teams are included in the Game ID, but I truly do not know if this is the right way to handle it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dataset looks like the below, where there is multiple rows with the same Game ID with different information in each column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions to solve this matter are kindly received.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 16:53:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2703985#M81947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-16T16:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering on two selected values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2703996#M81949</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;I would recommend 2 disconnected tables for your slicers. Both would be built using DISTINCT('Table'[teamname]). Then you could get the gameid's by doing something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
  VAR __TeamA = SELECTEDVALUE('Slicer1'[teamname])
  VAR __TeamB = SELECTEDVALUE('Slicer2'[teamname])
  VAR __TeamAGames = DISTINCT(SELECTCOLUMNS(FILTER('Table',[teamname] = __TeamA),"__gameid",[gameid]))
  VAR __TeamBGames = DISTINCT(SELECTCOLUMNS(FILTER('Table',[teamname] = __TeamB),"__gameid",[gameid]))
  VAR __SharedGames = INTERSECT(__TeamAGames, __TeamBGames)
...

  &lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Aug 2022 17:02:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2703996#M81949</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-08-16T17:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering on two selected values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2706229#M82064</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; Thanks for your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do kinda follow where you are going, however, I got no idea what to put into the return section of the measure, as I would like to display a table with all the gameid? - I do not see how I can filter the data tabel based on _SharedGames varaible?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 12:36:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2706229#M82064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-17T12:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering on two selected values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2706783#M82095</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Yeah, I wasn't sure either! But, perhaps you could use this code in a Complex Selector. Essentially return 1 or 0 and use the Filter pane to filter to the 1's (the rows you want included in the visual). So like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
  VAR __Game = MAX('Table'[gameid])
  VAR __TeamA = SELECTEDVALUE('Slicer1'[teamname])
  VAR __TeamB = SELECTEDVALUE('Slicer2'[teamname])
  VAR __TeamAGames = DISTINCT(SELECTCOLUMNS(FILTER('Table',[teamname] = __TeamA),"__gameid",[gameid]))
  VAR __TeamBGames = DISTINCT(SELECTCOLUMNS(FILTER('Table',[teamname] = __TeamB),"__gameid",[gameid]))
  VAR __SharedGames = INTERSECT(__TeamAGames, __TeamBGames)
RETURN
  IF(__Game IN __SharedGames, 1, 0)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534" target="_blank"&gt;The Complex Selector - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 13:20:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2706783#M82095</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-08-17T13:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering on two selected values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2739691#M84143</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description, I have created a simple sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;P&gt;First, create a new table of all the teams for slicer:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then creata a measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag =
IF (
    MAX ( 'Table'[Winning Team] )
        IN SELECTCOLUMNS ( 'For Slicer', "Team", [Team] )
            &amp;amp;&amp;amp; MAX ( 'Table'[Losing Team] ) IN SELECTCOLUMNS ( 'For Slicer', "Team", [Team] ),
    1,
    0
)
&lt;/LI-CODE&gt;
&lt;P&gt;Add it to the filter:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Jianbo Li&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 05:55:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-on-two-selected-values/m-p/2739691#M84143</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-09-01T05:55:40Z</dc:date>
    </item>
  </channel>
</rss>

