<?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 format result in switch statement? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1275627#M21597</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="133502" data-lia-user-login="michellepace" class="lia-mention lia-mention-user"&gt;michellepace&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can have a look at this video.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=xV8x7OTXIkE" target="_blank"&gt;https://www.youtube.com/watch?v=xV8x7OTXIkE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Aug 2020 19:56:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-05T19:56:49Z</dc:date>
    <item>
      <title>How to format result in switch statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1274337#M21518</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In the screenshot below I give my user the abolity to compare months either as an actual value or as a %. The problem is that I do not know how to force a percent format should my user select "As Percentage". In the (commented out) dax code below, I have tried to use the format() function but this breaks my entire visualisation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Diff LM = 
SWITCH( TRUE(),
    [Selected Metric] = "By Amount", [Diff. to LM],
    [Selected Metric] = "By Percent", [% Diff to LM],
    // [Selected Metric] = "By Percent", format([% Diff to LM], "Percent"),
[Diff. to LM] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to format my percentage case, I loose all my values like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 11:24:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1274337#M21518</guid>
      <dc:creator>michellepace</dc:creator>
      <dc:date>2020-08-05T11:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to format result in switch statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1274372#M21520</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="133502" data-lia-user-login="michellepace" class="lia-mention lia-mention-user"&gt;michellepace&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your measure seems fine, can you try it on new table visual. Check your Slicer it it returns a single value as expected.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Diff LM = 
SWITCH( TRUE(),
    [Selected Metric] = "By Amount", [Diff. to LM],
    [Selected Metric] = "By Percent", FORMAT([% Diff to LM], "Percent"),
    [Diff. to LM] 
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;Did I answer your question? Mark this post as a solution, this will help others!.&lt;/P&gt;&lt;P&gt;Click on the Thumbs-Up icon on the right if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank" rel="noopener"&gt;YouTube, &lt;/A&gt;&lt;A href="https://linkedin.com/in/fowmy" target="_blank" rel="noopener"&gt;LinkedIn&lt;/A&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 11:29:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1274372#M21520</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-08-05T11:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to format result in switch statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1275312#M21578</link>
      <description>Well, the short answer is: You can't do this unless you use the very newest feature that's only available through Tabular Editor called "calculation groups." Your only option right now is to create a new measure, only for display purposes, that will output correctly formatted values. However, the values will be TEXT, not real numbers. Such a measure should only be used in visualizations, not in calculations. For calculations you should use a measure that returns raw numbers.</description>
      <pubDate>Wed, 05 Aug 2020 16:47:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1275312#M21578</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-05T16:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to format result in switch statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1275627#M21597</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="133502" data-lia-user-login="michellepace" class="lia-mention lia-mention-user"&gt;michellepace&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can have a look at this video.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=xV8x7OTXIkE" target="_blank"&gt;https://www.youtube.com/watch?v=xV8x7OTXIkE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 19:56:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-format-result-in-switch-statement/m-p/1275627#M21597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-05T19:56:49Z</dc:date>
    </item>
  </channel>
</rss>

