<?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 Measure with table variable to filter table visual in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-table-variable-to-filter-table-visual/m-p/3695409#M143703</link>
    <description>&lt;P&gt;Hi - I have a table like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have a slicer on&amp;nbsp;&lt;STRONG&gt;Staff Name&lt;/STRONG&gt; and a table that shows other info in the table for the selected &lt;STRONG&gt;Staff Name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a measure I can use to filter a second table on the page to show other Staff that have the same Supervisor.&amp;nbsp; The second table is set to have no interaction with the slicer.&amp;nbsp; I've tried some variatons on this theme:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Measure = &lt;BR /&gt;&lt;BR /&gt;VAR _sup = SELECTEDVALUE(Table[Supervisor Name])&lt;BR /&gt;VAR _tab = SELECTCOLUMNS(filter(all(Table), Table[Supervisor Name] = _sup), "Supervisor", Table[Supervisor Name])&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;BR /&gt;&lt;BR /&gt;if(_sup in _tab, 1, 0)&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Countrows(_tab) shows the expected number of rows based on the person selected in the slicer, but the Measure seems to be set to 1 for all rows in Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have also tried using CALCULATETABLE with the same result.&amp;nbsp; School me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2024 05:05:54 GMT</pubDate>
    <dc:creator>rack201</dc:creator>
    <dc:date>2024-02-13T05:05:54Z</dc:date>
    <item>
      <title>Measure with table variable to filter table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-table-variable-to-filter-table-visual/m-p/3695409#M143703</link>
      <description>&lt;P&gt;Hi - I have a table like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have a slicer on&amp;nbsp;&lt;STRONG&gt;Staff Name&lt;/STRONG&gt; and a table that shows other info in the table for the selected &lt;STRONG&gt;Staff Name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a measure I can use to filter a second table on the page to show other Staff that have the same Supervisor.&amp;nbsp; The second table is set to have no interaction with the slicer.&amp;nbsp; I've tried some variatons on this theme:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Measure = &lt;BR /&gt;&lt;BR /&gt;VAR _sup = SELECTEDVALUE(Table[Supervisor Name])&lt;BR /&gt;VAR _tab = SELECTCOLUMNS(filter(all(Table), Table[Supervisor Name] = _sup), "Supervisor", Table[Supervisor Name])&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;BR /&gt;&lt;BR /&gt;if(_sup in _tab, 1, 0)&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Countrows(_tab) shows the expected number of rows based on the person selected in the slicer, but the Measure seems to be set to 1 for all rows in Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have also tried using CALCULATETABLE with the same result.&amp;nbsp; School me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 05:05:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-table-variable-to-filter-table-visual/m-p/3695409#M143703</guid>
      <dc:creator>rack201</dc:creator>
      <dc:date>2024-02-13T05:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with table variable to filter table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-table-variable-to-filter-table-visual/m-p/3697831#M143803</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="310874" data-lia-user-login="rack201" class="lia-mention lia-mention-user"&gt;rack201&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the testing as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tables:&lt;/P&gt;
&lt;P&gt;The table acts as a slicer.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a measure as follows&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _supername = CALCULATE(MAX('Table'[Supervisor Name]), FILTER('Table', [Staff Name] = SELECTEDVALUE('staff'[Staff Name])))
RETURN
IF(MAX('Table (2)'[Supervisor Name]) = _supername &amp;amp;&amp;amp; MAX('Table (2)'[Staff Name]) &amp;lt;&amp;gt; SELECTEDVALUE(staff[Staff Name]), 1, 0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put the measure into the visual-level filters, set up show items when the value is 1.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I've misunderstood you, please provide the result you are hoping for. Please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Xu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 03:24:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-table-variable-to-filter-table-visual/m-p/3697831#M143803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-14T03:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with table variable to filter table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-table-variable-to-filter-table-visual/m-p/3702370#M143990</link>
      <description>Amazing - thank you - that got me going!</description>
      <pubDate>Thu, 15 Feb 2024 20:45:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-table-variable-to-filter-table-visual/m-p/3702370#M143990</guid>
      <dc:creator>rack201</dc:creator>
      <dc:date>2024-02-15T20:45:35Z</dc:date>
    </item>
  </channel>
</rss>

