<?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: Dynamic Measures/Titles (Using SWITCH) in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/252990#M56</link>
    <description>&lt;P&gt;Thank you! This is very useful - I've been searching for an example like this!&lt;/P&gt;</description>
    <pubDate>Fri, 15 Sep 2017 14:53:14 GMT</pubDate>
    <dc:creator>wildmight2017</dc:creator>
    <dc:date>2017-09-15T14:53:14Z</dc:date>
    <item>
      <title>Dynamic Measures/Titles (Using SWITCH)</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/200718#M23</link>
      <description>&lt;P&gt;This Quick Measure allows you to display a different measure in the chart depending on the selection in a slicer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the attached example, there are 4 possible measures which can be chosen: (i) Avg Quantity Ordered, (ii) Avg Product Cost, (iii) Avg Tax Amount and (iv) Avg Unit price.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These measure names are defined in a single-column paramter table (manually entered or could be created automatically by the Quick Measures wizard). This column/table is used as the slicer selection and the measure shown in the bar chart is then calculated as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SelectedMeasure = IF(HASONEVALUE(tblParamMeasures[MeasureName]),SWITCH(VALUES(tblParamMeasures[MeasureName]),"Avg Unit Price",AVERAGE(fctSales[UnitPrice]),"Avg Quantity Ordered",AVERAGE(fctSales[OrderQuantity]),"Avg Tax Amount",AVERAGE(fctSales[TaxAmt]),"Avg Product Cost",AVERAGE(fctSales[ProductStandardCost])),AVERAGE(fctSales[UnitPrice]))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This expression&amp;nbsp;needs a default option in the event that a single measure name has not been selected and in this case this is the Average Unit Price.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is important for the chart to also have a dynamic title so that it is clear what is being displayed. The DAX expression for this could be something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure Title = IF(HASONEVALUE(tblParamMeasures[MeasureName]),VALUES(tblParamMeasures[MeasureName]),"Avg Unit Price") &amp;amp; " By Year -&amp;gt; Month -&amp;gt; Quarter -&amp;gt; Day"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is important to ensure the same default option (in this case Avg Unit Price) is used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiY2I1NjJmYjQtNWIzNy00NTFkLTg3N2UtMTM4YmFmNjA2MDA3IiwidCI6IjBjNzk5ZDM4LTQ3NjQtNDJiYy1iNGZmLTIzYmViYTljN2ZlMiIsImMiOjh9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2017 22:29:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/200718#M23</guid>
      <dc:creator>rsaprano</dc:creator>
      <dc:date>2017-06-24T22:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measures/Titles (Using SWITCH)</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/252990#M56</link>
      <description>&lt;P&gt;Thank you! This is very useful - I've been searching for an example like this!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:53:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/252990#M56</guid>
      <dc:creator>wildmight2017</dc:creator>
      <dc:date>2017-09-15T14:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measures/Titles (Using SWITCH)</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/532773#M235</link>
      <description>&lt;P&gt;This is just what I've been looking for.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It's a shame that theres no expression capability for titles on visuals.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 15:59:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/532773#M235</guid>
      <dc:creator>SQLArchitect</dc:creator>
      <dc:date>2018-10-03T15:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measures/Titles (Using SWITCH)</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/574406#M255</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for shairing this - it's great.&lt;/P&gt;
&lt;P&gt;However I wonder if this is possible to use in LiveQuery mode where I can't create separate table for measure.&lt;/P&gt;
&lt;P&gt;Do you have any workaround, suggested approach for this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 09:54:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Dynamic-Measures-Titles-Using-SWITCH/m-p/574406#M255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-28T09:54:54Z</dc:date>
    </item>
  </channel>
</rss>

