<?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: Return 0 % only when the outcome is actually 0, and blank otherwise in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3837312#M150027</link>
    <description>&lt;P&gt;Well, you can use the following &lt;FONT face="courier new,courier"&gt;RETURN&lt;/FONT&gt; statement instead:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RETURN
    IF(ISBLANK(CL / TOT), BLANK, CL / TOT)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try this out and let me know if this solves your issue. Also one more advice is to use &lt;FONT face="courier new,courier"&gt;DIVIDE()&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;"/"&lt;/FONT&gt; symbol:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DIVIDE(CL, TOT)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Udit&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accepting it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Appreciate your Kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt; Let's Connect: &lt;A href="https://www.linkedin.com/in/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkedIn&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://www.youtube.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;YouTube&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://medium.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Medium&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://github.com/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;GitHub&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Visit My Linktree: &lt;A href="https://linktr.ee/quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkTree&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Apr 2024 07:24:07 GMT</pubDate>
    <dc:creator>quantumudit</dc:creator>
    <dc:date>2024-04-15T07:24:07Z</dc:date>
    <item>
      <title>Return 0 % only when the outcome is actually 0, and blank otherwise</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3836894#M150008</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a measure in DAX that I visualize by week that shows the performance in %:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Clear (%) =&lt;/P&gt;&lt;P&gt;VAR CL =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DISTINCTCOUNT ( 'Data - InboundDeliveryRows'[Row_ID] ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Data - InboundDeliveryRows'[Clear] = 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ‘Data - InboundDeliveryRows'[ID_GoodsReceiptArrivalDate] &amp;lt;&amp;gt; -1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; || ‘Data - InboundDeliveryRows'[ID_GoodsReceiptArrivalDate] &amp;lt;&amp;gt; -2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILTER (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ‘Data - InboundDeliveryRows',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ‘Data - InboundDeliveryRows'[ordersortingnumber] = ‘Data - InboundDeliveryRows'[OrdernumberOrderRowNumberCount]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;VAR TOT =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT ( ‘Data - InboundDeliveryRows'[Row_ID] ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILTER (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ‘Data - InboundDeliveryRows',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ‘Data - InboundDeliveryRows'[ordersortingnumber] = ‘Data - InboundDeliveryRows'[OrdernumberOrderRowNumberCount]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CL / TOT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This measure shows 0% (correctly) if the outcome is 0% but it also shows 0% if the outcome is blank. Could you please help me adjust this measure so that if the outcome is blank I want to show blank for that week and only 0% if the actual outcome is 0%.&lt;BR /&gt;Which means, if no InboundDeliveryRows for one week then show blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to go from this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To this (if the outcome is actually blank):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 05:21:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3836894#M150008</guid>
      <dc:creator>mrclay82</dc:creator>
      <dc:date>2024-04-15T05:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Return 0 % only when the outcome is actually 0, and blank otherwise</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3837312#M150027</link>
      <description>&lt;P&gt;Well, you can use the following &lt;FONT face="courier new,courier"&gt;RETURN&lt;/FONT&gt; statement instead:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RETURN
    IF(ISBLANK(CL / TOT), BLANK, CL / TOT)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try this out and let me know if this solves your issue. Also one more advice is to use &lt;FONT face="courier new,courier"&gt;DIVIDE()&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;"/"&lt;/FONT&gt; symbol:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DIVIDE(CL, TOT)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Udit&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accepting it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Appreciate your Kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt; Let's Connect: &lt;A href="https://www.linkedin.com/in/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkedIn&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://www.youtube.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;YouTube&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://medium.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Medium&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://github.com/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;GitHub&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Visit My Linktree: &lt;A href="https://linktr.ee/quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkTree&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 07:24:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3837312#M150027</guid>
      <dc:creator>quantumudit</dc:creator>
      <dc:date>2024-04-15T07:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Return 0 % only when the outcome is actually 0, and blank otherwise</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3844606#M150277</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219243" data-lia-user-login="quantumudit" class="lia-mention lia-mention-user"&gt;quantumudit&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thanks for your quick reply!&lt;BR /&gt;&lt;BR /&gt;The first solution gives me the following error message:&lt;BR /&gt;"syntax or semantic error at line 8, position 36 (this is where the RETURN statement is): The syntax for ',' is incorrect."&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The second (DIVIDE) solution shows blank if the output is blank but now it also shows blank when the output is 0%&lt;BR /&gt;Do you have any suggestions here? Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 08:25:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3844606#M150277</guid>
      <dc:creator>mrclay82</dc:creator>
      <dc:date>2024-04-17T08:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Return 0 % only when the outcome is actually 0, and blank otherwise</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3867324#M151072</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="338956" data-lia-user-login="mrclay82" class="lia-mention lia-mention-user"&gt;mrclay82&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 06:27:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3867324#M151072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-25T06:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Return 0 % only when the outcome is actually 0, and blank otherwise</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3867368#M151076</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. It's a really complex data model so I don't really know how to make a dummy sample out of it =/&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 06:40:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3867368#M151076</guid>
      <dc:creator>mrclay82</dc:creator>
      <dc:date>2024-04-25T06:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Return 0 % only when the outcome is actually 0, and blank otherwise</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3867436#M151084</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="338956" data-lia-user-login="mrclay82" class="lia-mention lia-mention-user"&gt;mrclay82&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;try to change your return part as below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;measure=
return
if(
 DISTINCTCOUNT ( 'Data - InboundDeliveryRows'[Row_ID] )=blank(),blank(),CL/TOT
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;SPAN&gt;, please consider&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;accept as solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to help other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 06:59:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3867436#M151084</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-04-25T06:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Return 0 % only when the outcome is actually 0, and blank otherwise</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3888545#M151673</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for your suggestion, I really thought that this was the solution!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Unfortunatelly the output is the same as the DIVIDE suggestion from&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219243" data-lia-user-login="quantumudit" class="lia-mention lia-mention-user"&gt;quantumudit&lt;/a&gt;&amp;nbsp;, it&amp;nbsp;&lt;SPAN&gt;shows blank if the output is blank but now it also shows blank when the output is 0%&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know if we can fix it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 09:35:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3888545#M151673</guid>
      <dc:creator>mrclay82</dc:creator>
      <dc:date>2024-05-03T09:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Return 0 % only when the outcome is actually 0, and blank otherwise</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3917192#M152483</link>
      <description>&lt;P&gt;Does anyone have any other suggestions? Much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 11:45:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-0-only-when-the-outcome-is-actually-0-and-blank-otherwise/m-p/3917192#M152483</guid>
      <dc:creator>mrclay82</dc:creator>
      <dc:date>2024-05-14T11:45:06Z</dc:date>
    </item>
  </channel>
</rss>

