<?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: Differentiating between null value and zero in calculated column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differentiating-between-null-value-and-zero-in-calculated-column/m-p/3725912#M145126</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but please try something like below whether it suits your requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;%COG_IMP =
VAR _a =
    CALCULATE (
        COUNTA ( 'Interviews_All-Data'[Mind Active] ),
        'Interviews_All-Data'[Mind Active] IN { "Yes" }
    )
VAR _b =
    COUNTA ( 'Interviews_All-Data'[Mind Active] )
RETURN
    IF ( _a = 0 &amp;amp;&amp;amp; _b &amp;lt;&amp;gt; 0, 0, DIVIDE ( _a, _b, BLANK () ) )
&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 27 Feb 2024 03:57:47 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2024-02-27T03:57:47Z</dc:date>
    <item>
      <title>Differentiating between null value and zero in calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differentiating-between-null-value-and-zero-in-calculated-column/m-p/3725373#M145106</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**I'm reposting this with the addition of a .pbix and .csv file as the original post (&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-differentiate-between-null-value-and-zero-in/td-p/3482085" target="_blank"&gt;DAX command to differentiate between null value an... - Microsoft Fabric Community&lt;/A&gt;) has gone dead**&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've read a few posts along these lines and tried a few of the solutions but none appear to be working. The situation is that I have a calculated column that returns a simple percentage that is a calculation of a filtered value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[calculated%] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;COUNTA&lt;/SPAN&gt;&lt;SPAN&gt;([Value A]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Value A]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;{&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Yes"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;})), &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Value A]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is then displayed by site/timepoint in a table and box and whisker plots. The trouble is that I need to be able to distinguish between null values (unable to calculate because there's no data to calculate a percentage from) and returned value of 0% as this contributes to mean/median etc.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've tried adding +0 but this simply makes all null and 0% values the same. I also tried defining a variable and using an IF statement (maybe not very well!) but returns the same result:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;return&amp;nbsp;if(&amp;nbsp; &amp;nbsp; not ISBLANK([defined variable]), [defined variable],&amp;nbsp; &amp;nbsp; (if(&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [defined variable] = 0, 0, BLANK())&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is a link to the .pbix file and .csv data (I'm unable to directly attach these files unfortunately) -&amp;nbsp;&lt;A href="https://www.dropbox.com/scl/fo/zyhko4e7zr0ucxtdv453i/h?rlkey=z2f4bum5ybcb48eje5pdi4vyu&amp;amp;dl=0" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.dropbox.com/scl/fo/zyhko4e7zr0ucxtdv453i/h?rlkey=z2f4bum5ybcb48eje5pdi4vyu&amp;amp;dl=0&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any tips from the brains trust? None of the solutions thus far have worked and ChatGPT has been unable to solve it either!&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 27 Feb 2024 00:42:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differentiating-between-null-value-and-zero-in-calculated-column/m-p/3725373#M145106</guid>
      <dc:creator>AngelaB</dc:creator>
      <dc:date>2024-02-27T00:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Differentiating between null value and zero in calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differentiating-between-null-value-and-zero-in-calculated-column/m-p/3725912#M145126</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but please try something like below whether it suits your requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;%COG_IMP =
VAR _a =
    CALCULATE (
        COUNTA ( 'Interviews_All-Data'[Mind Active] ),
        'Interviews_All-Data'[Mind Active] IN { "Yes" }
    )
VAR _b =
    COUNTA ( 'Interviews_All-Data'[Mind Active] )
RETURN
    IF ( _a = 0 &amp;amp;&amp;amp; _b &amp;lt;&amp;gt; 0, 0, DIVIDE ( _a, _b, BLANK () ) )
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 03:57:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differentiating-between-null-value-and-zero-in-calculated-column/m-p/3725912#M145126</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-02-27T03:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Differentiating between null value and zero in calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differentiating-between-null-value-and-zero-in-calculated-column/m-p/3738491#M145750</link>
      <description>&lt;P&gt;Yes, this worked! Thank you, I knew there had to be simple solution but just couldn't get there. Thanks so much for your help.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2024 21:45:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differentiating-between-null-value-and-zero-in-calculated-column/m-p/3738491#M145750</guid>
      <dc:creator>AngelaB</dc:creator>
      <dc:date>2024-03-03T21:45:54Z</dc:date>
    </item>
  </channel>
</rss>

