<?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: Difference between results based on slicer selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2221286#M52757</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="251408" data-lia-user-login="George1973" class="lia-mention lia-mention-user"&gt;George1973&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You did not share a sample of data so I will explain my solution, then you can try it:&lt;/P&gt;&lt;P&gt;1- When you select 2 Items with Slicer the your table will be&amp;nbsp;filtered to show all data for those selected&amp;nbsp;&lt;SPAN&gt;customers&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;2- You need to write a measure, so first&amp;nbsp;add a VAR to create a table and add a rank column to it to rank rows based on the customers' names (ADDCOLUMN &amp;amp; RANKX), the output will be the filtered table with a column that has 1 and 2 (first customer and 2nd costumer)&lt;BR /&gt;3- then add another VAR (Name it S1) to SUMX a sales when the RANK is 1 (Filter RANK =1)&lt;/P&gt;&lt;P&gt;4- add another VAR to SUMX (Name it S2)a sale when the RANK is 2&amp;nbsp;(Filter RANK =1)&lt;/P&gt;&lt;P&gt;5- at the end (RETURN) S2-S1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;accepting&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;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.&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;BR /&gt;&lt;STRONG&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 05 Dec 2021 09:55:19 GMT</pubDate>
    <dc:creator>VahidDM</dc:creator>
    <dc:date>2021-12-05T09:55:19Z</dc:date>
    <item>
      <title>Difference between results based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2221280#M52756</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I have a column with all customers in it and a "Total Sales" measure.&lt;BR /&gt;I want to calculate a difference between selected two companies total sales based on a slicer company selection.&lt;/P&gt;&lt;P&gt;- I can not use Selectedvalue mesure, because it only works with one selection&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Power BI matrix grand totals work like I would like to see.. but vice versa.. I just want not a grand total, but "Grand Difference"..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advice,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;</description>
      <pubDate>Sun, 05 Dec 2021 09:41:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2221280#M52756</guid>
      <dc:creator>George1973</dc:creator>
      <dc:date>2021-12-05T09:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between results based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2221286#M52757</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="251408" data-lia-user-login="George1973" class="lia-mention lia-mention-user"&gt;George1973&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You did not share a sample of data so I will explain my solution, then you can try it:&lt;/P&gt;&lt;P&gt;1- When you select 2 Items with Slicer the your table will be&amp;nbsp;filtered to show all data for those selected&amp;nbsp;&lt;SPAN&gt;customers&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;2- You need to write a measure, so first&amp;nbsp;add a VAR to create a table and add a rank column to it to rank rows based on the customers' names (ADDCOLUMN &amp;amp; RANKX), the output will be the filtered table with a column that has 1 and 2 (first customer and 2nd costumer)&lt;BR /&gt;3- then add another VAR (Name it S1) to SUMX a sales when the RANK is 1 (Filter RANK =1)&lt;/P&gt;&lt;P&gt;4- add another VAR to SUMX (Name it S2)a sale when the RANK is 2&amp;nbsp;(Filter RANK =1)&lt;/P&gt;&lt;P&gt;5- at the end (RETURN) S2-S1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;accepting&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;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.&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;BR /&gt;&lt;STRONG&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Dec 2021 09:55:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2221286#M52757</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-12-05T09:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between results based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2221288#M52758</link>
      <description>&lt;P&gt;Thanks a lot,&lt;BR /&gt;I will try to develop a measure as you've suggested and let you know the status.&lt;BR /&gt;&lt;BR /&gt;(Regarding to the issue, that "Why I have not provided" a sample? - It's just en ordinary situation .. Total Sales summirizing the data from one column.. and Companies list from one column.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Dec 2021 10:01:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2221288#M52758</guid>
      <dc:creator>George1973</dc:creator>
      <dc:date>2021-12-05T10:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between results based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2226964#M53046</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="251408" data-lia-user-login="George1973" class="lia-mention lia-mention-user"&gt;George1973&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thanks in advance for your kind cooperation!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Community Support Team _ Caitlyn&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, 08 Dec 2021 06:31:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2226964#M53046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-08T06:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between results based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2240032#M53584</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, sorry for beeing late with the answer. I have write a measure according to your suggestion and it works fine.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Variance from Selected Companies = 
VAR summary =
    ADDCOLUMNS (ALLSELECTED(Item_Table[Company]), "cCompany", RANKX(ALLSELECTED(Item_Table[Company]),[Grand Total]))
VAR S1=
    CALCULATE([Grand Total],FILTER(summary,[cCompany]=1))
VAR S2=
    CALCULATE([Grand Total],FILTER(summary,[cCompany]=2))
Return
S1-S2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for assistance.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 10:22:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2240032#M53584</guid>
      <dc:creator>George1973</dc:creator>
      <dc:date>2021-12-15T10:22:06Z</dc:date>
    </item>
  </channel>
</rss>

