<?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: Getting a Percentage Measure to Show 0% for True 0s in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-Percentage-Measure-to-Show-0-for-True-0s/m-p/842366#M6430</link>
    <description>&lt;LI-CODE lang="markup"&gt;EventCompleted = 
VAR comletedEvents = IF(max(Event[CompletionDate])&amp;lt;&amp;gt;BLANK(),1,0)
var ontimecompletedEvents = IF(AND(MAX(Event[CompletionDate])&amp;lt;=MAX(Event[DueDate]),comletedEvents=1),1,0)
RETURN IF(comletedEvents=1,DIVIDE(comletedEvents,ontimecompletedEvents,0))&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 11 Nov 2019 11:04:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-11T11:04:54Z</dc:date>
    <item>
      <title>Getting a Percentage Measure to Show 0% for True 0s</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-Percentage-Measure-to-Show-0-for-True-0s/m-p/841337#M6376</link>
      <description>&lt;P&gt;I'm trying to create a measure that tracks whether an event was completed on time.&amp;nbsp; For each event, I have an event completion date and an event due date in my data.&amp;nbsp; If an event's completion date is &amp;lt;= the due date, that event is considered to have been completed on time.&amp;nbsp; If the completion date is &amp;gt; the due date, that event did not complete on time.&amp;nbsp; If an event has no completion date, I do not want this measure to calculate since it's not applicable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my data, I have an [Events_Completed] field that returns a 1 if the event's completion date is populated.&amp;nbsp; I also have an [Events_Completed_On_Time] field that returns a 1 if the event has a completion date, a due date, and the completion date is &amp;lt;= the due date; it returns a 0 if the event has a completion date, a due date, and the completion date is &amp;gt; the due date; and it returns nulls if the completion date and due date are not populated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In AAS, I have an [Events Completed] measure that is calculated as SUM ( 'Events'[Events_Completed] ), and I have an [Events Completed On Time] measure that is calculated as SUM ( 'Events'[Events_Completed_On_Time]).&amp;nbsp; Finally, my [Events Completed On Time %] measure is DIVIDE ( [Events Completed On Time], [Events Completed] ).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I view the percentage measure at a high level, everything looks good.&amp;nbsp; When I go down to the level of the individual event, however, my client wants to see 100% if an event completed on time, 0% if an event did not complete on time, and a blank if the event has not completed.&amp;nbsp; The problem is that the events that have a 0 for [Events_Completed_On_Time] and a 1 for [Events_Completed] in my data are returning as blanks when placed in a visual when I expect to see 0% instead.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that this is a quirk of Power BI, but I haven't been able to correct this with any of the usual tricks.&amp;nbsp; I can't just do DIVIDE ( [Events Completed On Time], [Events Completed] ) + 0 because that will give me 0% for everything, even if an event hasn't completed.&amp;nbsp; I've also tried IF ( NOT ( ISBLANK ( [Events Completed On Time] ) ), DIVIDE ( [Events Completed On Time], [Events Completed] ) + 0 ), but that still returns either 100% or blanks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some way I can alter this calculation so that I see 100% if an event was completed on time, a 0% if the event completed and was not on time, and a blank if the event has not yet completed?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 21:35:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-Percentage-Measure-to-Show-0-for-True-0s/m-p/841337#M6376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-08T21:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a Percentage Measure to Show 0% for True 0s</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-Percentage-Measure-to-Show-0-for-True-0s/m-p/842366#M6430</link>
      <description>&lt;LI-CODE lang="markup"&gt;EventCompleted = 
VAR comletedEvents = IF(max(Event[CompletionDate])&amp;lt;&amp;gt;BLANK(),1,0)
var ontimecompletedEvents = IF(AND(MAX(Event[CompletionDate])&amp;lt;=MAX(Event[DueDate]),comletedEvents=1),1,0)
RETURN IF(comletedEvents=1,DIVIDE(comletedEvents,ontimecompletedEvents,0))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Nov 2019 11:04:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-Percentage-Measure-to-Show-0-for-True-0s/m-p/842366#M6430</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-11T11:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a Percentage Measure to Show 0% for True 0s</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-Percentage-Measure-to-Show-0-for-True-0s/m-p/3235006#M118865</link>
      <description>&lt;P&gt;did you manage to figure this out? I am having the same issue?&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 07:18:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-Percentage-Measure-to-Show-0-for-True-0s/m-p/3235006#M118865</guid>
      <dc:creator>ukare1996</dc:creator>
      <dc:date>2023-05-15T07:18:44Z</dc:date>
    </item>
  </channel>
</rss>

