<?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: Can a scalar measure increase the row count of a table visual that is based on a single table? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346229#M24155</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;- No, it's COALESCE. Now that I am looking at it, COEALESCE essentially returns the first non-blank value for things. So that's why it is getting the hierarchies all weird. Since you are coalescing it's finding the H5 values even for the rows where the hierarchies end at 3. If you notice, only H4 and H5 are ever blank and if H5 is blank, then H4 is also blank or has a value that is predicated by an H3. So the only gaps you can possibly have are when sometimes the hiearchy in a row stops at H3 and some rows continue on to H5.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Sep 2020 03:19:08 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-09-04T03:19:08Z</dc:date>
    <item>
      <title>Can a scalar measure increase the row count of a table visual that is based on a single table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346114#M24150</link>
      <description>&lt;P&gt;This one has me scratching my head.&amp;nbsp; I always thought that scalar measures can only be an additional attribute to an existing physical row of data, or contribute to the aggregations. However below is a case where adding a measure to a table visual will increase the number of rows displayed in the visual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data Source SoC:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srPyFPSUUJGRkqxOnAJx7yUotRyZGlDrNK+iUWVBEyAKvFKzE0tJkGdV35xBpAyIEatR2piSUZqEUHlpcUlmXnEuAGm0CsxL7WEaGN9M5MzUnNyUtE1ANVlg/SlJOZiD05UBQGpJWC/4DImLz01JxG/QTAlYKcmws2KBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [H1 = _t, H2 = _t, H3 = _t, H4 = _t, H5 = _t, #"Span of control" = _t])
in
    Source&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table visual:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;SOC2 = Coalesce(CALCULATE(DISTINCTCOUNT(SoC[H5]),SoC[H5]&amp;lt;&amp;gt;""),CALCULATE(DISTINCTCOUNT(SoC[H4]),SoC[H4]&amp;lt;&amp;gt;""))&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;(the measure is not finished, but that's besides the point - I think)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Adding the measure as a table visual value gives:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV id="tinyMceEditorlbendlin_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorlbendlin_2" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorlbendlin_3" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;img /&gt;
&lt;P&gt;What would be the explanation for this behavior?&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 02:26:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346114#M24150</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-09-04T02:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can a scalar measure increase the row count of a table visual that is based on a single table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346166#M24152</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;- You have something strange going on there. Seems like some odd combination of weird internal DAX joins or something because the rows that show up are completely invalid hierarchies that aren't really "there"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are we still struggling with&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;'s stuff? I was helping her with some things earlier. Do we still have it in 5 seperate hierarchy columns? I was suggesting that maybe unpivoting those columns would make things easier.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 02:48:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346166#M24152</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-04T02:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can a scalar measure increase the row count of a table visual that is based on a single table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346211#M24154</link>
      <description>&lt;P&gt;No, I solved her question but the measure I came up with (based on SWITCH()) felt "wrong" and in need of improvement.&amp;nbsp; COALESCE() is technically very similar to SWITCH()&amp;nbsp; - kinda like SWITCH(NOT BLANK(),...) so I thought to give that a try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;COALESCE() seems to behave well with more than two parameters.&amp;nbsp; But with the two parameters in my example it seems to struggle. It is well possible that CALCULATE() plays a role here, but as far as I understand it CALCULATE cannot produce a table or a cross join.&amp;nbsp; Most likely I just don't understand DAX.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 03:10:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346211#M24154</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-09-04T03:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can a scalar measure increase the row count of a table visual that is based on a single table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346229#M24155</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;- No, it's COALESCE. Now that I am looking at it, COEALESCE essentially returns the first non-blank value for things. So that's why it is getting the hierarchies all weird. Since you are coalescing it's finding the H5 values even for the rows where the hierarchies end at 3. If you notice, only H4 and H5 are ever blank and if H5 is blank, then H4 is also blank or has a value that is predicated by an H3. So the only gaps you can possibly have are when sometimes the hiearchy in a row stops at H3 and some rows continue on to H5.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 03:19:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346229#M24155</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-04T03:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can a scalar measure increase the row count of a table visual that is based on a single table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346232#M24156</link>
      <description>&lt;P&gt;Note that none of the cells are blank - they are empty strings.&amp;nbsp; Might be worth replacing these with actual blanks to see if it behaves different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regardless, if COALESCE returns the first non-blank value then how can that one single value increase the row count? From the looks of it COALESCE returns two values in this scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 03:23:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1346232#M24156</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-09-04T03:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can a scalar measure increase the row count of a table visual that is based on a single table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1348996#M24234</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;I think this has something to do with AutoExist, maybe&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="41" data-lia-user-login="marcorusso" class="lia-mention lia-mention-user"&gt;marcorusso&lt;/a&gt;&amp;nbsp;can help with the behaviour here.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 13:52:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1348996#M24234</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-09-05T13:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can a scalar measure increase the row count of a table visual that is based on a single table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1349240#M24244</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp; I think you are on to something here, but the article on AutoExist&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/understanding-dax-auto-exist/" target="_blank"&gt;https://www.sqlbi.com/articles/understanding-dax-auto-exist/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;specifically mentions SUMMARIZECOLUMNS vs CALCULATETABLE, and seems to imply that AutoExist produces fewer results, not more&amp;nbsp; (although to be fair my issue does not create more results, only more table visual row renderers).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which query is produced by COALESCE?&amp;nbsp; I whittled the issue down to just show H3, H4 and H5 plus the SOC2 measure.&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;// DAX Query
DEFINE
  VAR __DS0Core = 
    SUMMARIZECOLUMNS(
      ROLLUPADDISSUBTOTAL(ROLLUPGROUP('SoC'[H3], 'SoC'[H4], 'SoC'[H5]), "IsGrandTotalRowTotal"),
      "SOC22", 'SoC'[SOC2]
    )

  VAR __DS0PrimaryWindowed = 
    TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'SoC'[H3], 1, 'SoC'[H4], 1, 'SoC'[H5], 1)

EVALUATE
  __DS0PrimaryWindowed

ORDER BY
  [IsGrandTotalRowTotal] DESC, 'SoC'[H3], 'SoC'[H4], 'SoC'[H5]
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;trying to figure out if this gives a clue &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&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;</description>
      <pubDate>Sat, 05 Sep 2020 21:32:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-a-scalar-measure-increase-the-row-count-of-a-table-visual/m-p/1349240#M24244</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-09-05T21:32:56Z</dc:date>
    </item>
  </channel>
</rss>

