<?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 Define Percentage format in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-Percentage-format-in-DAX/m-p/902484#M8299</link>
    <description>&lt;DIV&gt;&lt;SPAN&gt;Coverage% = If(Divide(SUM('IHFD vwCoverage'[IHFD]),SUM('IHFD vwCoverage'[HIPE]))&amp;gt;1,100,FORMAT(Divide(SUM('IHFD vwCoverage'[IHFD]),SUM('IHFD vwCoverage'[HIPE])),"0.0%"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For Percentages greater than 100% I set to 100% , but I want to display 100% (No decimal place 0%) in this instance and when percentage is less than 100 .ie. 98.7 I want to illustrate as 0.0%&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I tried setting the measure to General format via the modelling menu and I tried setting the default format to Percentage with 0 decimal places in the&amp;nbsp;via the modelling menu, use dax as above to set to 1 decemial place&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can this be done in dax, have two different formats based on derived value&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Thu, 16 Jan 2020 18:05:21 GMT</pubDate>
    <dc:creator>carlol</dc:creator>
    <dc:date>2020-01-16T18:05:21Z</dc:date>
    <item>
      <title>Define Percentage format in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-Percentage-format-in-DAX/m-p/902484#M8299</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Coverage% = If(Divide(SUM('IHFD vwCoverage'[IHFD]),SUM('IHFD vwCoverage'[HIPE]))&amp;gt;1,100,FORMAT(Divide(SUM('IHFD vwCoverage'[IHFD]),SUM('IHFD vwCoverage'[HIPE])),"0.0%"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For Percentages greater than 100% I set to 100% , but I want to display 100% (No decimal place 0%) in this instance and when percentage is less than 100 .ie. 98.7 I want to illustrate as 0.0%&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I tried setting the measure to General format via the modelling menu and I tried setting the default format to Percentage with 0 decimal places in the&amp;nbsp;via the modelling menu, use dax as above to set to 1 decemial place&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can this be done in dax, have two different formats based on derived value&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Jan 2020 18:05:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-Percentage-format-in-DAX/m-p/902484#M8299</guid>
      <dc:creator>carlol</dc:creator>
      <dc:date>2020-01-16T18:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Define Percentage format in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-Percentage-format-in-DAX/m-p/902635#M8314</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="173272" data-lia-user-login="carlol" class="lia-mention lia-mention-user"&gt;carlol&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If I understand your challenge, you want something like the corresponding value on the right for the calculated value on the left?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;If so, your original measure is almost there - the issue is that the 100 you're returning for your &amp;gt; 100 scenario is being treated as a raw number, and then a text value for anything less than that in the form of the &lt;FONT face="courier new,courier"&gt;FORMAT&lt;/FONT&gt; calculation. The result is just stuck in as resolved.&lt;/P&gt;&lt;P&gt;To make all values the same type, just modify the 100 to the text value &lt;STRONG&gt;"100%"&lt;/STRONG&gt;, e.g.:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Coverage% =
IF (
    DIVIDE ( SUM ( 'IHFD vwCoverage'[IHFD] ), SUM ( 'IHFD vwCoverage'[HIPE] ) ) &amp;gt;= 1,
    "100%",
    FORMAT (
        DIVIDE ( SUM ( 'IHFD vwCoverage'[IHFD] ), SUM ( 'IHFD vwCoverage'[HIPE] ) ),
        "0.0%"
    )
)&lt;/LI-CODE&gt;&lt;P&gt;(note that your orignal formula would return anything derived as 100% as "100.0%" as this isn't &lt;EM&gt;greater than&lt;/EM&gt; 1, so I modified the operator to be &lt;EM&gt;greater than or equal to&lt;/EM&gt;)&lt;/P&gt;&lt;P&gt;Here's an alternative solution that reduces calculation logic for the % result and gives you a threshold you can easily modify if you change your logic later on:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Coverage % =
VAR Threshold = 1
VAR Result =
    DIVIDE ( SUM ( 'IHFD vwCoverage'[IHFD] ), SUM ( 'IHFD vwCoverage'[HIPE] ) )
RETURN
    IF (
        Result &amp;gt;= Threshold,
        FORMAT ( Threshold, "0%" ),
        FORMAT ( Result, "0.0%" )
    )&lt;/LI-CODE&gt;&lt;P&gt;Hopefully this is all you need to carry on.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;FONT size="2"&gt;If my post helps, then please consider accepting as a solution to help other forum members find the answer more quickly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 22:32:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-Percentage-format-in-DAX/m-p/902635#M8314</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2020-01-16T22:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Define Percentage format in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-Percentage-format-in-DAX/m-p/903425#M8345</link>
      <description>&lt;P&gt;Thanks Daniel!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 12:59:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-Percentage-format-in-DAX/m-p/903425#M8345</guid>
      <dc:creator>carlol</dc:creator>
      <dc:date>2020-01-17T12:59:51Z</dc:date>
    </item>
  </channel>
</rss>

