<?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: Divide the count of rows from one column with the count of non-blank rows from another column. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4587404#M175734</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1228743" data-lia-user-login="KandiBawa" class="lia-mention lia-mention-user"&gt;KandiBawa&lt;/a&gt;&amp;nbsp;Hi! Try with a one single measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dynamic Sem Sentiment = &lt;BR /&gt;VAR TotalNonBlankComments = CALCULATE(COUNTROWS(Table1), Table1[Calendar Comments] &amp;lt;&amp;gt; BLANK())&lt;BR /&gt;RETURN &lt;BR /&gt;DIVIDE(COUNTROWS(Table1), TotalNonBlankComments)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BBF&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2025 07:56:34 GMT</pubDate>
    <dc:creator>BeaBF</dc:creator>
    <dc:date>2025-02-27T07:56:34Z</dc:date>
    <item>
      <title>Divide the count of rows from one column with the count of non-blank rows from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4586875#M175720</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 columns that I want to use here:&lt;/P&gt;&lt;P&gt;1. Comments: This is a text column where people have either put in a comment or left it blank.&lt;/P&gt;&lt;P&gt;2. Sentiment: This is also a text column with 4 possible values (Positive, Negative, Neutral, and NA)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the % of each sentiment type for all the non-blank comments.&lt;BR /&gt;I.e. (Count of Sentiment Type/Non-Blank comments)*100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used the following measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Total Comments =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table1&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;Table1&lt;/SPAN&gt;&lt;SPAN&gt;[Calendar Comments]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;On using this in a card visual it gives me the right value. I.e. 3675 non-blank comments.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Dynamic Sem Sentiment =&lt;/SPAN&gt; &lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table1&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;3675&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using this when I have hard coded the denominator gives me the right result (see screenshot 1).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But if I update the measure to make it dynamic I.e&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Dynamic Sem Sentiment =&lt;/SPAN&gt; &lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table1&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;MeasureTable&lt;/SPAN&gt;&lt;SPAN&gt;[Total Comments]&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;It gives me an incorrect result. (See screenshot 2)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can you please explain why this is happening and how to fix this?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TIA&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Feb 2025 00:51:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4586875#M175720</guid>
      <dc:creator>KandiBawa</dc:creator>
      <dc:date>2025-02-27T00:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Divide the count of rows from one column with the count of non-blank rows from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4587404#M175734</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1228743" data-lia-user-login="KandiBawa" class="lia-mention lia-mention-user"&gt;KandiBawa&lt;/a&gt;&amp;nbsp;Hi! Try with a one single measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dynamic Sem Sentiment = &lt;BR /&gt;VAR TotalNonBlankComments = CALCULATE(COUNTROWS(Table1), Table1[Calendar Comments] &amp;lt;&amp;gt; BLANK())&lt;BR /&gt;RETURN &lt;BR /&gt;DIVIDE(COUNTROWS(Table1), TotalNonBlankComments)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BBF&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 07:56:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4587404#M175734</guid>
      <dc:creator>BeaBF</dc:creator>
      <dc:date>2025-02-27T07:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Divide the count of rows from one column with the count of non-blank rows from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4593890#M175920</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1228743" data-lia-user-login="KandiBawa" class="lia-mention lia-mention-user"&gt;KandiBawa&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can update [Total Comments] measure as below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Comments =
CALCULATE (
    COUNTROWS ( Table1 ),
    FILTER ( ALLSELECTED ( Table1 ), Table1[Calendar Comments] &amp;lt;&amp;gt; BLANK () )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 01:59:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4593890#M175920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-03-04T01:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Divide the count of rows from one column with the count of non-blank rows from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4594492#M175937</link>
      <description>&lt;P&gt;If I understand the requirement correctly, it's like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Dynamic Sem Sentiment = DIVIDE(
	CALCULATE(COUNTROWS(Table1), Table1[Calendar Comments] &amp;lt;&amp;gt; BLANK())
	,CALCULATE(COUNTROWS(Table1),ALL(Table1[Sentiment]), Table1[Calendar Comments] &amp;lt;&amp;gt; BLANK())

)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 04 Mar 2025 08:25:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-the-count-of-rows-from-one-column-with-the-count-of-non/m-p/4594492#M175937</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2025-03-04T08:25:34Z</dc:date>
    </item>
  </channel>
</rss>

