<?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: How to get multiple results from SWITCH() function? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-multiple-results-from-SWITCH-function/m-p/1381187#M25245</link>
    <description>&lt;P&gt;This worked like a charm!&lt;/P&gt;</description>
    <pubDate>Fri, 18 Sep 2020 22:15:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-18T22:15:35Z</dc:date>
    <item>
      <title>How to get multiple results from SWITCH() function?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-multiple-results-from-SWITCH-function/m-p/1380904#M25236</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to output multiple results depending on the selected field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These multiple results are an average, an upper bound and lower bound standard deviation:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This works well as I have put every field into the lines, but I am trying to toggle to share of volume and get the wrong values&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;These bounds and averages are calculations for the previous metric. So I am trying to make a switch statement for the lines in this visual to select the proper bounds and average depending on the selected metric with the following formula:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Bounds = 
switch(
    SELECTEDVALUE(Range[Metric]),
        "CRT", 'Verizon Call Reason'[YMax CRT],
        "CRT", 'Verizon Call Reason'[YMin CRT],
        "CRT", 'Verizon Call Reason'[Avg CRT],
        "% Share Volume",'Verizon Call Reason'[YMax V%],
        "% Share Volume", 'Verizon Call Reason'[YMin V%],
        "% Share Volume", 'Verizon Call Reason'[Avg V%],
        0
)&lt;/LI-CODE&gt;&lt;P&gt;But this only gives me an aggregate of the upper, lower, and average line as something I do not need.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I keep these bounds depending on the filter measure I select?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 18:11:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-multiple-results-from-SWITCH-function/m-p/1380904#M25236</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-18T18:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple results from SWITCH() function?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-multiple-results-from-SWITCH-function/m-p/1381182#M25244</link>
      <description>&lt;P&gt;The logic behind switch is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if value equals X than "show me this", otherwise&lt;/P&gt;&lt;P&gt;if value equals Y than "show me that", ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you've wrote is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if value equals X than "show me this", otherwise&lt;/P&gt;&lt;P&gt;if value equals X than "show me that", ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However this cannot work since X cannot equal 2 conditions at the same time. You cannot have "CRT" 3 times and "% Share Volume" also 3 times.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to create 3 separate switch functions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Upper Bound = 
switch(
    SELECTEDVALUE(Range[Metric]),
        "CRT", 'Verizon Call Reason'[YMax CRT],
        "% Share Volume",'Verizon Call Reason'[YMax V%],
        0
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Lower Bound = 
switch(
    SELECTEDVALUE(Range[Metric]),
        "CRT", 'Verizon Call Reason'[YMin CRT],
        "% Share Volume", 'Verizon Call Reason'[YMin V%],
        0
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Average = 
switch(
    SELECTEDVALUE(Range[Metric]),
        "CRT", 'Verizon Call Reason'[Avg CRT],
        "% Share Volume", 'Verizon Call Reason'[Avg V%],
        0
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 18 Sep 2020 22:10:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-multiple-results-from-SWITCH-function/m-p/1381182#M25244</guid>
      <dc:creator>zaza</dc:creator>
      <dc:date>2020-09-18T22:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple results from SWITCH() function?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-multiple-results-from-SWITCH-function/m-p/1381187#M25245</link>
      <description>&lt;P&gt;This worked like a charm!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 22:15:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-multiple-results-from-SWITCH-function/m-p/1381187#M25245</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-18T22:15:35Z</dc:date>
    </item>
  </channel>
</rss>

