<?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 DAX - FORMAT with SWITCH in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1396503#M25645</link>
    <description>&lt;P&gt;I have 2 slicers that are used allow the end-user select what measure they want to see:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am using a SWITCH function to switch between different measures, but I would like to format these as 4 of them are currency and the other 2 are whole numbers. However, when I do this it does not allow me to put the measure into my charts because of the custom formatting:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;M_MeasureSelection = 
VAR MeasureSelect = SELECTEDVALUE(MeasureSelection[MeasureType]) &amp;amp; " " &amp;amp; SELECTEDVALUE(MeasureSelection[Measure])

RETURN
    SWITCH (
        TRUE (),
        MeasureSelect = "Booked ADR",
            FORMAT([M_BookedADR], "$#.##"),
        MeasureSelect = "Booked Revenue",
            FORMAT([M_BookedRevenue], "$#.##"),
        MeasureSelect = "Booked Room Nights",
            FORMAT([M_BookedRoomNights], "#.##"),
        MeasureSelect = "Actualized ADR",
            FORMAT([M_ActualizedADR], "$#.##"),
        MeasureSelect = "Actualized Revenue",
            FORMAT([M_ActualizedRevenue], "$#.##"),
        MeasureSelect = "Actualized Room Nights",
            FORMAT([M_ActualizedRoomNights], "#.##")
    )&lt;/LI-CODE&gt;&lt;P&gt;It does work with my charts when I take out the FORMAT functions:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;M_MeasureSelection2 = 
VAR MeasureSelect = SELECTEDVALUE(MeasureSelection[MeasureType]) &amp;amp; " " &amp;amp; SELECTEDVALUE(MeasureSelection[Measure])

RETURN
    SWITCH (
        TRUE (),
        MeasureSelect = "Booked ADR",
            [M_BookedADR],
        MeasureSelect = "Booked Revenue",
            [M_BookedRevenue],
        MeasureSelect = "Booked Room Nights",
            [M_BookedRoomNights],
        MeasureSelect = "Actualized ADR",
            [M_ActualizedADR],
        MeasureSelect = "Actualized Revenue",
            [M_ActualizedRevenue],
        MeasureSelect = "Actualized Room Nights",
            [M_ActualizedRoomNights]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on this? Any other options or do I just have to remove the formatting?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2020 19:12:39 GMT</pubDate>
    <dc:creator>zfemmer</dc:creator>
    <dc:date>2020-09-25T19:12:39Z</dc:date>
    <item>
      <title>DAX - FORMAT with SWITCH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1396503#M25645</link>
      <description>&lt;P&gt;I have 2 slicers that are used allow the end-user select what measure they want to see:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am using a SWITCH function to switch between different measures, but I would like to format these as 4 of them are currency and the other 2 are whole numbers. However, when I do this it does not allow me to put the measure into my charts because of the custom formatting:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;M_MeasureSelection = 
VAR MeasureSelect = SELECTEDVALUE(MeasureSelection[MeasureType]) &amp;amp; " " &amp;amp; SELECTEDVALUE(MeasureSelection[Measure])

RETURN
    SWITCH (
        TRUE (),
        MeasureSelect = "Booked ADR",
            FORMAT([M_BookedADR], "$#.##"),
        MeasureSelect = "Booked Revenue",
            FORMAT([M_BookedRevenue], "$#.##"),
        MeasureSelect = "Booked Room Nights",
            FORMAT([M_BookedRoomNights], "#.##"),
        MeasureSelect = "Actualized ADR",
            FORMAT([M_ActualizedADR], "$#.##"),
        MeasureSelect = "Actualized Revenue",
            FORMAT([M_ActualizedRevenue], "$#.##"),
        MeasureSelect = "Actualized Room Nights",
            FORMAT([M_ActualizedRoomNights], "#.##")
    )&lt;/LI-CODE&gt;&lt;P&gt;It does work with my charts when I take out the FORMAT functions:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;M_MeasureSelection2 = 
VAR MeasureSelect = SELECTEDVALUE(MeasureSelection[MeasureType]) &amp;amp; " " &amp;amp; SELECTEDVALUE(MeasureSelection[Measure])

RETURN
    SWITCH (
        TRUE (),
        MeasureSelect = "Booked ADR",
            [M_BookedADR],
        MeasureSelect = "Booked Revenue",
            [M_BookedRevenue],
        MeasureSelect = "Booked Room Nights",
            [M_BookedRoomNights],
        MeasureSelect = "Actualized ADR",
            [M_ActualizedADR],
        MeasureSelect = "Actualized Revenue",
            [M_ActualizedRevenue],
        MeasureSelect = "Actualized Room Nights",
            [M_ActualizedRoomNights]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on this? Any other options or do I just have to remove the formatting?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 19:12:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1396503#M25645</guid>
      <dc:creator>zfemmer</dc:creator>
      <dc:date>2020-09-25T19:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - FORMAT with SWITCH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1396629#M25652</link>
      <description>&lt;P&gt;You could use the technique I describe here to solve this issue.&amp;nbsp;&lt;A href="https://exceleratorbi.com.au/dynamic-formatting-of-switch-measures/" target="_blank"&gt;https://exceleratorbi.com.au/dynamic-formatting-of-switch-measures/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 21:46:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1396629#M25652</guid>
      <dc:creator>MattAllington</dc:creator>
      <dc:date>2020-09-25T21:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - FORMAT with SWITCH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1399969#M25747</link>
      <description>&lt;P&gt;This would for sure help me, but we are still on an old version of Power BI Desktop because they have not updated our report server since January.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe this is just another reason to push for it. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:01:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1399969#M25747</guid>
      <dc:creator>zfemmer</dc:creator>
      <dc:date>2020-09-28T17:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - FORMAT with SWITCH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1399983#M25749</link>
      <description>&lt;P&gt;Do you know if this is even available for Power BI Report Server?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like it was released in July for Power BI Service, but Report Server hasn't had a release since May.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:08:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-FORMAT-with-SWITCH/m-p/1399983#M25749</guid>
      <dc:creator>zfemmer</dc:creator>
      <dc:date>2020-09-28T17:08:37Z</dc:date>
    </item>
  </channel>
</rss>

