<?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: Showing 0 instead of nothing (null), adding COALESCE breaks filtering (hierarchy) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2284311#M55976</link>
    <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;I think you can just add + 0 to the end of your measure and you will get a 0 vs. null.&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jan 2022 19:02:43 GMT</pubDate>
    <dc:creator>Whitewater100</dc:creator>
    <dc:date>2022-01-14T19:02:43Z</dc:date>
    <item>
      <title>Showing 0 instead of nothing (null), adding COALESCE breaks filtering (hierarchy)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2284167#M55966</link>
      <description>&lt;P&gt;I have a Measure in a matrix showing a mix of actual values and (null) values. Reason is that not for all lines the metric exists.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Actual Open Purchase Cost = SUM('Fact PurchaseTransactionValues'[ActualOpenPurchaseCost])&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;The matrix also has a hiearchy: Customer Transation - Customer Transaction Line&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desire is to replace (null) with 0. So I added COALESCE to the defintion in a new measure&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Actual Open Purchase Cost 2 = COALESCE(SUM('Fact PurchaseTransactionValues'[ActualOpenPurchaseCost]); 0)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But when I add this new measure to the matrix the relation between the fact table and the used dimensions seems lost: I get all lines under eacht Customer Transaction, not only the lines for that Customer Transaction&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Jan 2022 16:44:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2284167#M55966</guid>
      <dc:creator>PierrreVelraeds</dc:creator>
      <dc:date>2022-01-14T16:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Showing 0 instead of nothing (null), adding COALESCE breaks filtering (hierarchy)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2284311#M55976</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;I think you can just add + 0 to the end of your measure and you will get a 0 vs. null.&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 19:02:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2284311#M55976</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-01-14T19:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Showing 0 instead of nothing (null), adding COALESCE breaks filtering (hierarchy)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2284385#M55983</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Unfornunately that gives the same result.&lt;/P&gt;&lt;P&gt;I tried to reproduce in a simple example:&amp;nbsp;&lt;A title="Example issue NULL and COALESCE" href="https://1drv.ms/u/s!AlEGdH3jOJfahvEK2u9dBBPBmVKggQ?e=wgWML8" target="_blank" rel="noopener"&gt;Example issue NULL and COALESCE.pbix&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks that when the hiearchy in de matrix has fields from more than two other (Dim) tables the hierachy shows alle values instead of values filtered by the hierarchy.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 20:23:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2284385#M55983</guid>
      <dc:creator>PierrreVelraeds</dc:creator>
      <dc:date>2022-01-14T20:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Showing 0 instead of nothing (null), adding COALESCE breaks filtering (hierarchy)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2290374#M56283</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="295966" data-lia-user-login="PierrreVelraeds" class="lia-mention lia-mention-user"&gt;PierrreVelraeds&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be better to select both Product and Description columns from Dim table into the matrix as Rows fields. Then you will not have this problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The cause is the cross-filter direction of the relationship between Dim table and Fact table. In below image, you have a single cross-filter direction relationship from Dim Prod to Fact table. This means that Dim Prod table can filter Fact table, but Fact table cannot filter Dim Prod table. When you put ProductName from Fact table into the matrix, and put Description from Dim table into it at a lower&amp;nbsp;hiearchy level than ProductName, ProductName is not able to filter Description. As a result, it display all rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards, &lt;BR /&gt;Community Support Team _ Jing&lt;BR /&gt;If this post helps, please Accept it as Solution to help other members find it.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 06:58:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2290374#M56283</guid>
      <dc:creator>v-jingzhang</dc:creator>
      <dc:date>2022-01-19T06:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Showing 0 instead of nothing (null), adding COALESCE breaks filtering (hierarchy)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2298557#M56684</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="254615" data-lia-user-login="v-jingzhang" class="lia-mention lia-mention-user"&gt;v-jingzhang&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried changing the cross-filter direction from single-&amp;gt;both in the model but that does not help. Am I doing something wrong?&lt;BR /&gt;&lt;BR /&gt;We have a datawarehouse which is set up with Fact and Dimension tables in which dimensions are coupled via star schema or snowflake. The fact tables only contain metrics and surrogate keys to the dimensions. Adding chracteristics of dimensions to the fact table is no option.&lt;/P&gt;&lt;P&gt;In the example I added a Dim ProductGroup which is also coupled to the fact table. This represents my situation better.&lt;BR /&gt;The hiearchy is OK untill the measure with coalesce function or + 0 is added.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that using coalesce or +0 creates a value for every possible combination disregarding the combinations in the data or relations in the model. Somehow is logical as there is always a value, but&amp;nbsp;I am wondering what the use case is for this behaviour.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Workaround for this is to create an additional measure that determines if all values used are blank. This meaure can then be used to filter out the combinations where all values are blank. But this is can make maintenance harder and time consuming. E.g. when adding or removing a measure to a visual this extra measure needs to be updated too.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AlEGdH3jOJfahvE8zVMN8ql4CjPSTA?e=xShLhn" target="_blank" rel="noopener"&gt;Example issue NULL and COALESCE 2.pbix&lt;/A&gt;&amp;nbsp;for used examples and measures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a simpler solution that only replaces the blanks with 0?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 13:06:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-0-instead-of-nothing-null-adding-COALESCE-breaks/m-p/2298557#M56684</guid>
      <dc:creator>PierrreVelraeds</dc:creator>
      <dc:date>2022-01-24T13:06:49Z</dc:date>
    </item>
  </channel>
</rss>

