<?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: Switch Formula on Multiple Selection on Slicer? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178764#M114865</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543267" data-lia-user-login="HELPME_JFLO" class="lia-mention lia-mention-user"&gt;HELPME_JFLO&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;=&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'Product Line Filter'[Lowest] ),&lt;BR /&gt;SWITCH (&lt;BR /&gt;'Product Line Filter'[Lowest],&lt;BR /&gt;"A", [9775 - SALES_GAL],&lt;BR /&gt;"B", [16034 - SALES_LBS_ETHYLENE]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Sun, 09 Apr 2023 07:48:14 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-04-09T07:48:14Z</dc:date>
    <item>
      <title>Switch Formula on Multiple Selection on Slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178700#M114859</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a what I think, a pretty simple model/ask I am asking of Power BI (I think), and still can't figure out what I'm doing wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one fact table and a product line (category) dimension table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current code is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;selection_lowest&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;= &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'Product Line Filter'[Lowest]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SALES_GAL&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[9775 - SALES_GAL]&lt;/P&gt;&lt;P&gt;var&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SALES_LBS&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[9380 - SALES_LBS]&lt;/P&gt;&lt;P&gt;var&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SALES_LBS_ETH&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[16034 - SALES_LBS_ETHYLENE]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var A&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE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true(),&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;selection_lowest = "A", A,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;selection_lowest = "B", B,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;selection_lowest in {"A","B"},&amp;nbsp; A + B,&lt;/P&gt;&lt;P&gt;0 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Context: Essentially I have a slicer (Product Line Lowest), that works for "A" and "B" on their own levels, however, when both selected they do not sum together as expected, but instead return a 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or direction would be appreciated!&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2023 03:36:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178700#M114859</guid>
      <dc:creator>HELPME_JFLO</dc:creator>
      <dc:date>2023-04-09T03:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula on Multiple Selection on Slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178746#M114864</link>
      <description>&lt;P&gt;hi&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543267" data-lia-user-login="HELPME_JFLO" class="lia-mention lia-mention-user"&gt;HELPME_JFLO&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at least first try like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;VAR selection_lowest =&amp;nbsp;&amp;nbsp;SELECTEDVALUE ( 'Product Line Filter'[Lowest] )&lt;DIV&gt;//var SALES_GAL = [9775 - SALES_GAL]&lt;DIV&gt;//var SALES_LBS = [9380 - SALES_LBS]&lt;DIV&gt;//var SALES_LBS_ETH = [16034 - SALES_LBS_ETHYLENE]&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;var A = CALCULATE([9775 - SALES_GAL], FILTER('Product Line Filter',[Lowest] = "A"))&lt;DIV&gt;var B = CALCULATE([16034 - SALES_LBS_ETHYLENE], FILTER('Product Line Filter',[Lowest] = "B"))&lt;DIV&gt;return&lt;DIV&gt;switch(&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;true(),&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;selection_lowest = "A", A,&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;selection_lowest = "B", B,&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;selection_lowest in {"A","B"},&amp;nbsp;&amp;nbsp;A + B,&lt;DIV&gt;0 )&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;Hard to believe, but variables in DAX are actually constant values.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 09 Apr 2023 06:25:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178746#M114864</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-04-09T06:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula on Multiple Selection on Slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178764#M114865</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543267" data-lia-user-login="HELPME_JFLO" class="lia-mention lia-mention-user"&gt;HELPME_JFLO&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;=&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'Product Line Filter'[Lowest] ),&lt;BR /&gt;SWITCH (&lt;BR /&gt;'Product Line Filter'[Lowest],&lt;BR /&gt;"A", [9775 - SALES_GAL],&lt;BR /&gt;"B", [16034 - SALES_LBS_ETHYLENE]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2023 07:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178764#M114865</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-09T07:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula on Multiple Selection on Slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178916#M114877</link>
      <description>&lt;P&gt;Hey thanks for trying, but it still produced the same output unfortunately.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2023 16:08:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178916#M114877</guid>
      <dc:creator>HELPME_JFLO</dc:creator>
      <dc:date>2023-04-09T16:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula on Multiple Selection on Slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178917#M114878</link>
      <description>&lt;P&gt;Thanks for trying, but regardless of the variables it still produced the same output as original &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2023 16:08:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178917#M114878</guid>
      <dc:creator>HELPME_JFLO</dc:creator>
      <dc:date>2023-04-09T16:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula on Multiple Selection on Slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178942#M114880</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543267" data-lia-user-login="HELPME_JFLO" class="lia-mention lia-mention-user"&gt;HELPME_JFLO&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please provide some screenshots?&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2023 17:50:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3178942#M114880</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-09T17:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula on Multiple Selection on Slicer?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3213752#M117275</link>
      <description>&lt;P&gt;You could try using SELECTEDVALUE().&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Var A=....&lt;BR /&gt;Var B=...&lt;BR /&gt;&lt;BR /&gt;Return SWITCH(SELECTEDVALUE(Selection_lowest),&amp;nbsp;&lt;/P&gt;&lt;P&gt;"A", A,&lt;/P&gt;&lt;P&gt;"B", B,&lt;/P&gt;&lt;P&gt;A+B)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you choose distinct filter choices, you get the respective measures back. But once you choose more than one filter, you will get the alternate result (in this case A+B).&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/best-practices/dax-selectedvalue" target="_blank"&gt;https://learn.microsoft.com/en-us/dax/best-practices/dax-selectedvalue&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 12:54:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-on-Multiple-Selection-on-Slicer/m-p/3213752#M117275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-01T12:54:57Z</dc:date>
    </item>
  </channel>
</rss>

