<?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: Store slicer selections from a user and compare the selection against others in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442808#M130830</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="601805" data-lia-user-login="JoeBarry" class="lia-mention lia-mention-user"&gt;JoeBarry&lt;/a&gt;&amp;nbsp;, both the costs are there in the same table. If an user selects one city, we should be able to calculate the difference in cost with the other cities in that table.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _SelCost = SUM(Table1[Cost])
VAR _Cost = SUM(Table1[Cost)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2023 10:19:56 GMT</pubDate>
    <dc:creator>Bari</dc:creator>
    <dc:date>2023-09-22T10:19:56Z</dc:date>
    <item>
      <title>Store slicer selections from a user and compare the selection against others</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442467#M130811</link>
      <description>&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Group&lt;/TD&gt;&lt;TD&gt;Sub-Grp&lt;/TD&gt;&lt;TD&gt;Country&lt;/TD&gt;&lt;TD&gt;City&lt;/TD&gt;&lt;TD&gt;Cost&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;USA&lt;/TD&gt;&lt;TD&gt;Tallahassee&lt;/TD&gt;&lt;TD&gt;118.02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;Germany&lt;/TD&gt;&lt;TD&gt;Berlin&lt;/TD&gt;&lt;TD&gt;73.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;Italy&lt;/TD&gt;&lt;TD&gt;Trieste&lt;/TD&gt;&lt;TD&gt;39.08&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;Italy&lt;/TD&gt;&lt;TD&gt;Cosenza&lt;/TD&gt;&lt;TD&gt;27.09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;France&lt;/TD&gt;&lt;TD&gt;Strasbourg&lt;/TD&gt;&lt;TD&gt;67.33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;India&lt;/TD&gt;&lt;TD&gt;Bengaluru&lt;/TD&gt;&lt;TD&gt;18.32&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In power BI, there will be 4 slicers, Group, Track, Country and City. If an user selects SI, CDO, USA and Tallahassee, cost 118.02 will be shown on a card. Now, I need to show in another table visual what are the best 3 lowest cost city compared to the user selection and show the % difference. Output should look like:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Group&lt;/TD&gt;&lt;TD&gt;Sub-Grp&lt;/TD&gt;&lt;TD&gt;Country&lt;/TD&gt;&lt;TD&gt;City&lt;/TD&gt;&lt;TD&gt;Actual Cost&lt;/TD&gt;&lt;TD&gt;User selected Cost&lt;/TD&gt;&lt;TD&gt;% diff&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;India&lt;/TD&gt;&lt;TD&gt;Bengaluru&lt;/TD&gt;&lt;TD&gt;18.32&lt;/TD&gt;&lt;TD&gt;118.02&lt;/TD&gt;&lt;TD&gt;84.48%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;Italy&lt;/TD&gt;&lt;TD&gt;Cosenza&lt;/TD&gt;&lt;TD&gt;27.09&lt;/TD&gt;&lt;TD&gt;118.02&lt;/TD&gt;&lt;TD&gt;77.05%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SI&lt;/TD&gt;&lt;TD&gt;CDO&lt;/TD&gt;&lt;TD&gt;Italy&lt;/TD&gt;&lt;TD&gt;Trieste&lt;/TD&gt;&lt;TD&gt;39.08&lt;/TD&gt;&lt;TD&gt;118.02&lt;/TD&gt;&lt;TD&gt;66.89%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Please suggest how to achieve this.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 06:37:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442467#M130811</guid>
      <dc:creator>Bari</dc:creator>
      <dc:date>2023-09-22T06:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Store slicer selections from a user and compare the selection against others</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442532#M130813</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="480064" data-lia-user-login="Bari" class="lia-mention lia-mention-user"&gt;Bari&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the 2nd visual, turn off the interaction between the Country and City and the 2nd table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Highlight the Country Slicer, in the ribbion a Format tab will appear. Click on Edit interactions. While the slicer is highlighted, turn off the interaction in the 2nd table by clicking on this icon&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;repeat for the city slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within the table open the filter pane right. Within the cost part go to filter type and choose Top N and add the Cost measure to the By value field. Then in Show items choose bottom and enter 3 in the empty field and then apply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should do it for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If this post helps, then please Accept it as the solution&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 07:17:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442532#M130813</guid>
      <dc:creator>JoeBarry</dc:creator>
      <dc:date>2023-09-22T07:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Store slicer selections from a user and compare the selection against others</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442597#M130817</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="601805" data-lia-user-login="JoeBarry" class="lia-mention lia-mention-user"&gt;JoeBarry&lt;/a&gt;&amp;nbsp;, thank you for your reply. I alredy turned off the interaction. The issue is I could not store the user selected value as a reference point in my table which is 118.02 in the example. and then I need to show the dirrence between 118.02 and 18.32 which is 84.48%. When I a trying to place the user_selected_value measure in the table, instead of 118.02 it is giving me 18.32 only for Bangalore.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 07:55:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442597#M130817</guid>
      <dc:creator>Bari</dc:creator>
      <dc:date>2023-09-22T07:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Store slicer selections from a user and compare the selection against others</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442748#M130825</link>
      <description>&lt;P&gt;This will work if one City is filtered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a measure&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cost Difference % = 
VAR _SelCost = SUM(Table1[Cost])
VAR _Cost = SUM(Table2[Cost)
VAR _Diff = _SelCost - _Cost

RETURN
DIVIDE(_Diff , _SelCost)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Convert to % and add to Visual&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 09:44:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442748#M130825</guid>
      <dc:creator>JoeBarry</dc:creator>
      <dc:date>2023-09-22T09:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Store slicer selections from a user and compare the selection against others</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442808#M130830</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="601805" data-lia-user-login="JoeBarry" class="lia-mention lia-mention-user"&gt;JoeBarry&lt;/a&gt;&amp;nbsp;, both the costs are there in the same table. If an user selects one city, we should be able to calculate the difference in cost with the other cities in that table.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _SelCost = SUM(Table1[Cost])
VAR _Cost = SUM(Table1[Cost)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 10:19:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3442808#M130830</guid>
      <dc:creator>Bari</dc:creator>
      <dc:date>2023-09-22T10:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Store slicer selections from a user and compare the selection against others</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3447013#M131173</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="480064" data-lia-user-login="Bari" class="lia-mention lia-mention-user"&gt;Bari&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated table.&lt;/P&gt;
&lt;P&gt;Create a slicer table that has no relationship to the main table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 =
SUMMARIZE(
    'Table','Table'[Group],'Table'[Sub-Grp],'Table'[Country],'Table'[City])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;selected Cost =
var _selectgroup=SELECTEDVALUE('Table 2'[Group])
var _selectsubgroup=SELECTEDVALUE('Table 2'[Sub-Grp])
var _selectcountry=SELECTEDVALUE('Table 2'[Country])
var _selectcity=SELECTEDVALUE('Table 2'[City])
return
SUMX(
FILTER(ALL('Table'),
'Table'[Group]=_selectgroup&amp;amp;&amp;amp;'Table'[Sub-Grp]=_selectsubgroup&amp;amp;&amp;amp;'Table'[Country]=_selectcountry&amp;amp;&amp;amp;'Table'[City]=_selectcity),[Cost])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Flag =
var _selectgroup=SELECTEDVALUE('Table 2'[Group])
var _selectsubgroup=SELECTEDVALUE('Table 2'[Sub-Grp])
var _rank=
RANKX(
    FILTER(ALL('Table'),
'Table'[Group]=_selectgroup&amp;amp;&amp;amp;'Table'[Sub-Grp]=_selectsubgroup),CALCULATE(SUM('Table'[Cost])),,ASC)
return
IF(
    _rank&amp;lt;=3,1,0)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;% diff =
DIVIDE(
    [selected Cost]-SUM('Table'[Cost]),[selected Cost])&lt;/LI-CODE&gt;
&lt;P&gt;3. Place [Flag]in Filters, set is=1, apply filter.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;4. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 04:09:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3447013#M131173</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-26T04:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Store slicer selections from a user and compare the selection against others</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3447049#M131177</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Thank you so much for your help. It worked.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 05:03:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3447049#M131177</guid>
      <dc:creator>Bari</dc:creator>
      <dc:date>2023-09-26T05:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Store slicer selections from a user and compare the selection against others</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3447070#M131180</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;one more question for you. I have different groups and sub-groups for the same countries and cities in my data. How to keep the slicer selection for group and sub-group constant and show the ranking of city based on the slicer selection of group and sub-group?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 05:33:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-slicer-selections-from-a-user-and-compare-the-selection/m-p/3447070#M131180</guid>
      <dc:creator>Bari</dc:creator>
      <dc:date>2023-09-26T05:33:53Z</dc:date>
    </item>
  </channel>
</rss>

