<?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: Formatting with a SWITCH function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1728658#M35786</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added "ISCROSSFILTERED" and checking actually a value exists in my switch funtion but format option didn't work out.&lt;/P&gt;&lt;P&gt;My final measure is dependant on multiple measures.&lt;/P&gt;&lt;P&gt;Are there any steps needs to be taken.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 21:15:09 GMT</pubDate>
    <dc:creator>Mond</dc:creator>
    <dc:date>2021-03-17T21:15:09Z</dc:date>
    <item>
      <title>Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1355908#M24498</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a SWITCH function to select between cases and revenue as a measure. For cases, the format should be a whole number. For revenue, the format should be currency. This is my formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure Selection = IF(ISCROSSFILTERED('Measure'[Measure]), 
SWITCH(
    TRUE(), 
    VALUES('Measure'[Measure]) = "Gross Revenue", FORMAT([Total Sales], "Currency"), 
    VALUES('Measure'[Measure]) = "Cases", FORMAT([Total Quantity], "0"),
    BLANK()), BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;where [Total Sales] = CALCULATE(SUM([Sales])) and [Total Quantity] = CALCULATE(SUM([Cases]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my 'Measure' table:&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 use FORMAT, my table shows blank values:&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 don't use the FORMAT function, my values do not naturally format the way I would like them to:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two possible solutions:&lt;/P&gt;&lt;P&gt;1. Find a way to get rid of the blank rows&lt;/P&gt;&lt;P&gt;2. Use a function other than FORMAT to format my values into whole numbers and currency.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's some sample data:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Product&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Cases&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E.Com - Cakes &amp;amp; Pies/Shells&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E.Com - Cakes &amp;amp; Pies/Shells&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Pound Cake&lt;/TD&gt;&lt;TD&gt;4000&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Pound Cake&lt;/TD&gt;&lt;TD&gt;1472&lt;/TD&gt;&lt;TD&gt;368&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 19:05:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1355908#M24498</guid>
      <dc:creator>ratgdillon</dc:creator>
      <dc:date>2020-09-08T19:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1355952#M24500</link>
      <description>&lt;P&gt;In your SWITCH statement you need to also check that there is actually a value, or FORMAT will happily produce an empty string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;Measure Selection = IF(ISCROSSFILTERED('Measure'[Measure]), 
SWITCH(
    TRUE(), 
    VALUES('Measure'[Measure]) = "Gross Revenue" &amp;amp;&amp;amp; [Total Sales]&amp;lt;&amp;gt;0, FORMAT([Total Sales], "Currency"), 
    VALUES('Measure'[Measure]) = "Cases" &amp;amp;&amp;amp; [Total Quantity]&amp;gt;0, FORMAT([Total Quantity], "0"),
    BLANK()), BLANK())&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Sep 2020 19:45:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1355952#M24500</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-09-08T19:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1357011#M24538</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="255050" data-lia-user-login="ratgdillon" class="lia-mention lia-mention-user"&gt;ratgdillon&lt;/a&gt; , I think you have to use max here &lt;/P&gt;
&lt;P&gt;Measure Selection = IF(ISCROSSFILTERED('Measure'[Measure]), &lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(), &lt;BR /&gt;Max('Measure'[Measure]) = "Gross Revenue", FORMAT([Total Sales], "Currency"), &lt;BR /&gt;max('Measure'[Measure]) = "Cases", FORMAT([Total Quantity], "0"),&lt;BR /&gt;BLANK()), BLANK())&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this will make date type as text .&lt;/P&gt;
&lt;P&gt;This example can also help you how to handle measure Slicer -&lt;A href="https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern" target="_blank"&gt;https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 05:30:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1357011#M24538</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-09-09T05:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1728658#M35786</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added "ISCROSSFILTERED" and checking actually a value exists in my switch funtion but format option didn't work out.&lt;/P&gt;&lt;P&gt;My final measure is dependant on multiple measures.&lt;/P&gt;&lt;P&gt;Are there any steps needs to be taken.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 21:15:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1728658#M35786</guid>
      <dc:creator>Mond</dc:creator>
      <dc:date>2021-03-17T21:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1830377#M38911</link>
      <description>&lt;P&gt;Why this is not working for stacked Chart?&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 14:59:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1830377#M38911</guid>
      <dc:creator>NilR</dc:creator>
      <dc:date>2021-05-07T14:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1830384#M38912</link>
      <description>&lt;P&gt;I have Stacked Chart, but can't get this working. do you have any other solution?&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 15:01:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/1830384#M38912</guid>
      <dc:creator>NilR</dc:creator>
      <dc:date>2021-05-07T15:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/2881824#M93310</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hi lbenlin,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am new to DAX and I have tried to implement your solution into my query, but I am not sure where I am going wrong? Below is my selector measure and switch measure that I have created as measures. This "&lt;STRONG&gt;selector measure&lt;/STRONG&gt;" is used as a toggle between the different metrics ($ and FTE). I then put on a "Card" visual the "&lt;STRONG&gt;Switch Measure:"&lt;/STRONG&gt; which changes according to the toggle.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Everytime i switch to the Currency metric, the Symbol does not display at all. Can you pleae help me modify my measures to allow the Currency symbol to display when only the $ metric is selected?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Selector Measure:&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Selector = &lt;/SPAN&gt;&lt;SPAN&gt;UNION&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ROW&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Type"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"Hrs."&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ROW&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Type"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"Wks."&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ROW&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Type"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"FTE"&lt;/SPAN&gt;&lt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PAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"FTE"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Costing (FTE)]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Nov 2022 05:42:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/2881824#M93310</guid>
      <dc:creator>Deevo_</dc:creator>
      <dc:date>2022-11-03T05:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/2883114#M93385</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="426400" data-lia-user-login="Deevo_" class="lia-mention lia-mention-user"&gt;Deevo_&lt;/a&gt;&amp;nbsp;please create a new post with your question&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 14:09:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/2883114#M93385</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-11-03T14:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/3146754#M112584</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, I'm looking a measure that change the format the format of salesAmount dynamically based on currency selection slicer and you give me this code : Sales Amount Selected Currency = VAR SelectedCurrency = SELECTEDVALUE('SlicerTable'[Currency]) RETURN IF(SelectedCurrency = "Local", SUM('SalesTable'[SalesAmount]), IF(SelectedCurrency = "Euro", FORMAT(SUM('SalesTable'[SalesAmount_EUR]), "€#,##0.00"), IF(SelectedCurrency = "Dollar", FORMAT(SUM('SalesTable'[SalesAmount_EUR]), "$#,##0.00") ) ) ) the problem when i use this measure, it show me a blank values out of the range sales dates (my sales dates years 2022 and 2023 before using the measure , after using the measure i found year 2014 and 2015 with blank values). how we can solve the problem ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 09:31:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/3146754#M112584</guid>
      <dc:creator>ahmadov_10</dc:creator>
      <dc:date>2023-03-22T09:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting with a SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/3146975#M112597</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="310748" data-lia-user-login="ahmadov_10" class="lia-mention lia-mention-user"&gt;ahmadov_10&lt;/a&gt;&amp;nbsp;please create a new post. Include sample data.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 11:19:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formatting-with-a-SWITCH-function/m-p/3146975#M112597</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-03-22T11:19:05Z</dc:date>
    </item>
  </channel>
</rss>

