<?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: DAX measure modification to display measure although result is 0 in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-modification-to-display-measure-although-result-is-0/m-p/2195587#M51416</link>
    <description>&lt;P&gt;Yes!&amp;nbsp; &amp;nbsp;I knew it had something to do with how it's trying to evaluate the value.&amp;nbsp; It's been quite some time since I've done any coding (as you can obviously tell) so I really appreciate the explaination behind the fix - AND for making it even easier!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do need to SUM the values, but not for this particular visual I am trying to build.&amp;nbsp; &amp;nbsp;You're a ROCKSTAR!&amp;nbsp; Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 02:04:17 GMT</pubDate>
    <dc:creator>rhaddad87</dc:creator>
    <dc:date>2021-11-18T02:04:17Z</dc:date>
    <item>
      <title>DAX measure modification to display measure although result is 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-modification-to-display-measure-although-result-is-0/m-p/2195553#M51414</link>
      <description>&lt;P&gt;Hi, PowerBi community!&amp;nbsp; I have a DAX function that I use to get the most recent date from a report and show the flight hours for that date, I've pasted the screenshot below.&amp;nbsp; It works really well, however, when the flight hours for a date is 0, the function returns the flight hours for the last date where the flight hours were not 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a particular DAX function I can add so it returns a value even if it's 0?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I'm also very new to this so I apologize if I used incorrect terminologies for functions and such)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 01:29:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-modification-to-display-measure-although-result-is-0/m-p/2195553#M51414</guid>
      <dc:creator>rhaddad87</dc:creator>
      <dc:date>2021-11-18T01:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure modification to display measure although result is 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-modification-to-display-measure-although-result-is-0/m-p/2195586#M51415</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="339517" data-lia-user-login="rhaddad87" class="lia-mention lia-mention-user"&gt;rhaddad87&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to explain what's currently happening with your measure.&lt;/P&gt;
&lt;P&gt;The first variable expression&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR HoursDate =
CALCULATE (
    MAX ( 'xxData'[Date] ),
    'xxData[Flight Hours]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is equivalent to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR HoursDate =
CALCULATE (
    MAX ( 'xxData'[Date] ),
    'xxData[Flight Hours] &amp;lt;&amp;gt; 0
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;since a reference to a numerical value when a boolean expression is expected evaluates to TRUE only if the value is nonzero.&lt;/P&gt;
&lt;P&gt;This is the reason that you end up with the max date where Flight Hours is nonzero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would actually suggest rewriting the entire measure in a simpler way, updated to include dates where Flight Hours is zero. Does this work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Most Recent Hours = 
CALCULATE (
    SELECTEDVALUE ( 'xxData'[Flight Hours] ),
    LASTDATE ( 'xxData'[Date] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One comment: SELECTEDVALUE will only return a nonblank result if their is a single distinct value of Flight Hours in the context where it is evaluated. Would you consider SUM instead, or are you certain you never need to sum Flight Hours?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 02:10:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-modification-to-display-measure-although-result-is-0/m-p/2195586#M51415</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2021-11-18T02:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure modification to display measure although result is 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-modification-to-display-measure-although-result-is-0/m-p/2195587#M51416</link>
      <description>&lt;P&gt;Yes!&amp;nbsp; &amp;nbsp;I knew it had something to do with how it's trying to evaluate the value.&amp;nbsp; It's been quite some time since I've done any coding (as you can obviously tell) so I really appreciate the explaination behind the fix - AND for making it even easier!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do need to SUM the values, but not for this particular visual I am trying to build.&amp;nbsp; &amp;nbsp;You're a ROCKSTAR!&amp;nbsp; Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 02:04:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-modification-to-display-measure-although-result-is-0/m-p/2195587#M51416</guid>
      <dc:creator>rhaddad87</dc:creator>
      <dc:date>2021-11-18T02:04:17Z</dc:date>
    </item>
  </channel>
</rss>

