<?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 Need to compare multiple rows in the same table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3738166#M145736</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help with this problem. I have a table like this:&lt;BR /&gt;BRAND | CUSTOMER | VALUE&lt;BR /&gt;A | X | 1&lt;/P&gt;&lt;P&gt;A | Y | 1&lt;/P&gt;&lt;P&gt;B | X | 2&lt;/P&gt;&lt;P&gt;B | Y | 0&lt;/P&gt;&lt;P&gt;C | X | 1&lt;/P&gt;&lt;P&gt;C | Y | 1&lt;/P&gt;&lt;P&gt;C | Z | 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brand is a slicer in my page. Based on the combination of brands the user selects, I need to return a table which shows only the customer with a positive value (&amp;gt;0) for each and every selected Brand.&lt;/P&gt;&lt;P&gt;For example, if A &amp;amp; B are selected, the result should be:&lt;BR /&gt;CUSTOMER | VALUE&lt;/P&gt;&lt;P&gt;X | 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While if A &amp;amp; C are selected:&lt;BR /&gt;X | 2&lt;BR /&gt;Y | 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eventually, I need to create measures to count the number of customers active in multiple brands, and the total value they generate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;alepagg&lt;/P&gt;</description>
    <pubDate>Sun, 03 Mar 2024 09:42:53 GMT</pubDate>
    <dc:creator>alepagg</dc:creator>
    <dc:date>2024-03-03T09:42:53Z</dc:date>
    <item>
      <title>Need to compare multiple rows in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3738166#M145736</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help with this problem. I have a table like this:&lt;BR /&gt;BRAND | CUSTOMER | VALUE&lt;BR /&gt;A | X | 1&lt;/P&gt;&lt;P&gt;A | Y | 1&lt;/P&gt;&lt;P&gt;B | X | 2&lt;/P&gt;&lt;P&gt;B | Y | 0&lt;/P&gt;&lt;P&gt;C | X | 1&lt;/P&gt;&lt;P&gt;C | Y | 1&lt;/P&gt;&lt;P&gt;C | Z | 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brand is a slicer in my page. Based on the combination of brands the user selects, I need to return a table which shows only the customer with a positive value (&amp;gt;0) for each and every selected Brand.&lt;/P&gt;&lt;P&gt;For example, if A &amp;amp; B are selected, the result should be:&lt;BR /&gt;CUSTOMER | VALUE&lt;/P&gt;&lt;P&gt;X | 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While if A &amp;amp; C are selected:&lt;BR /&gt;X | 2&lt;BR /&gt;Y | 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eventually, I need to create measures to count the number of customers active in multiple brands, and the total value they generate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;alepagg&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2024 09:42:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3738166#M145736</guid>
      <dc:creator>alepagg</dc:creator>
      <dc:date>2024-03-03T09:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare multiple rows in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3738227#M145738</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Here is one way to do this:&lt;BR /&gt;&lt;BR /&gt;Create the following measure:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Filter for above &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (24)'&lt;/SPAN&gt;&lt;SPAN&gt;[Value]&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Place is as a filter like this:&lt;BR /&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
Now the slicer works as you described:&lt;BR /&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 03 Mar 2024 11:59:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3738227#M145738</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2024-03-03T11:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare multiple rows in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3739373#M145786</link>
      <description>&lt;P&gt;Hi Valtteri,&lt;/P&gt;&lt;P&gt;thanks for your prompt reply but I think it doesn't fully cover my need.&lt;/P&gt;&lt;P&gt;Back to my example, when the user selects both A &amp;amp; B brands, the only customer that shows positive value for both brands is X. Therefore, the outcome measure or table should be only:&lt;BR /&gt;X | 3&lt;BR /&gt;While customer Y should be excluded since it is positive for brand A but not positive for brand B.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 08:22:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3739373#M145786</guid>
      <dc:creator>alepagg</dc:creator>
      <dc:date>2024-03-04T08:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare multiple rows in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3741603#M145912</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="699567" data-lia-user-login="alepagg" class="lia-mention lia-mention-user"&gt;alepagg&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2) We can create a measure.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag = 
var _table=CALCULATETABLE(VALUES('Table'[CUSTOMER]),'Table'[VALUE]&amp;lt;=0)
RETURN IF( not MAX('Table'[CUSTOMER]) in _table,1,0)&lt;/LI-CODE&gt;
&lt;P&gt;(3) Place [Flag=1] on the visual object screening and then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 03:31:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3741603#M145912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-05T03:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare multiple rows in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3742694#M145966</link>
      <description>&lt;P&gt;Hi Neeko,&lt;/P&gt;&lt;P&gt;Thanks a lot for your help! Your solution does work!&lt;/P&gt;&lt;P&gt;However, my real scenario is quite complex and it's hard to replicate your proposal to my dashboard. Maybe you know how to use the Flag to calculate a measure&lt;BR /&gt;- the number of Customers active in multiple Brands&lt;BR /&gt;- the total value generated by the above Customers&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Alessandro&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 10:39:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3742694#M145966</guid>
      <dc:creator>alepagg</dc:creator>
      <dc:date>2024-03-05T10:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare multiple rows in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3745371#M146060</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="699567" data-lia-user-login="alepagg" class="lia-mention lia-mention-user"&gt;alepagg&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;SPAN&gt;COUNTROWS()&lt;/SPAN&gt; function to count&amp;nbsp;&lt;SPAN&gt;the number of Customers active in multiple Brands.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can use the SUMX() function to calculate&amp;nbsp;the total value generated by the above Customers.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For more details, refer:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/countrows-function-dax" target="_blank"&gt;COUNTROWS function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/sumx-function-dax" target="_blank"&gt;SUMX function (DAX) - DAX | Microsoft Learn&lt;/A&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;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 08:12:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-compare-multiple-rows-in-the-same-table/m-p/3745371#M146060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-06T08:12:33Z</dc:date>
    </item>
  </channel>
</rss>

