<?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: Conditional formatting a switch measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677722#M34367</link>
    <description>&lt;P&gt;Thank you for the prompt reply! I tried this however get an error, will the Format function make my measure into text?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Message:&lt;BR /&gt;MdxScript(Model) (110, 1) Calculation error in measure '_Measure_Selection_Cycle'[&lt;EM&gt;(Selected) Value&lt;/EM&gt;]: Cannot convert value '' of type Text to type Numeric/Date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Feb 2021 15:33:04 GMT</pubDate>
    <dc:creator>MrDatanaut</dc:creator>
    <dc:date>2021-02-19T15:33:04Z</dc:date>
    <item>
      <title>Conditional formatting a switch measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677512#M34358</link>
      <description>&lt;P&gt;Dear PBI Community!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following switch-measure which is used to show different financial and volume measures within one and the same visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am looking to do is have "(Selected) Value" be formatted with 2 decimals IF "volume" is selected from the dropdown and show no decimals if any other of the values is selected (Revenue, CM or GP).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me accomplish this in the DAX below?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(Selected) Value =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;VAR Selection = SELECTEDVALUE('Dim_Measure_Selection_Master'[Value Types], "ALL" )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SWITCH(true(),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Selection = "Volume", [Volume (MT)],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Selection = "Revenue", [Total Revenue ($)],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Selection = "Contribution Margin", [Total Contribution Margin ($)],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Selection = "Gross Profit", [Total Gross Profit ($)],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[Total Contribution Margin ($)]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 13:48:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677512#M34358</guid>
      <dc:creator>MrDatanaut</dc:creator>
      <dc:date>2021-02-19T13:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting a switch measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677582#M34362</link>
      <description>&lt;P&gt;Use the FORMAT function to get the result, but the best way is to use calculate group&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 14:18:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677582#M34362</guid>
      <dc:creator>jameszhang0805</dc:creator>
      <dc:date>2021-02-19T14:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting a switch measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677722#M34367</link>
      <description>&lt;P&gt;Thank you for the prompt reply! I tried this however get an error, will the Format function make my measure into text?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Message:&lt;BR /&gt;MdxScript(Model) (110, 1) Calculation error in measure '_Measure_Selection_Cycle'[&lt;EM&gt;(Selected) Value&lt;/EM&gt;]: Cannot convert value '' of type Text to type Numeric/Date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 15:33:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677722#M34367</guid>
      <dc:creator>MrDatanaut</dc:creator>
      <dc:date>2021-02-19T15:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting a switch measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677779#M34368</link>
      <description>&lt;P&gt;yes the return value type of format is string&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 16:16:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formatting-a-switch-measure/m-p/1677779#M34368</guid>
      <dc:creator>jameszhang0805</dc:creator>
      <dc:date>2021-02-19T16:16:04Z</dc:date>
    </item>
  </channel>
</rss>

