<?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: Count of rows on a Card does not agree with what is rendered. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3472159#M132593</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446607" data-lia-user-login="DallasBaba" class="lia-mention lia-mention-user"&gt;DallasBaba&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thanks for your most recent suggestion.&amp;nbsp; I think I have partially figured out the problem though.&amp;nbsp; Sometimes after we make a delivery we need to credit the delivery back and rebill it.&amp;nbsp; So now our one delivery turns into two deliveries and one offsetting credit.&amp;nbsp; I ended up adding the Invoice Number to the row context and it rendured the second delivery which agreed with with my count.&amp;nbsp; However, the SQL query I used to load the data requested 'Qty &amp;gt;= 0', which is why the credit did not show.&amp;nbsp; My final problem is to figure out a way for the system to only count my original delivery and not the second one used in the&amp;nbsp; adjustment.&lt;/P&gt;&lt;P&gt;If you have any thoughts on that I would love to hear them.&amp;nbsp; I very much appreciate your time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2023 20:54:07 GMT</pubDate>
    <dc:creator>BudMan512</dc:creator>
    <dc:date>2023-10-11T20:54:07Z</dc:date>
    <item>
      <title>Count of rows on a Card does not agree with what is rendered.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3469731#M132465</link>
      <description>&lt;P&gt;I am having a problem where the count of rows on a Card for a filtered table does not agree with what is actually rendered.&amp;nbsp; The total count is displayed on a card and the actual rows displayed in a table do not always agree.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking at a customer’s delivery to determine whether it was on time, late, early or if it was Out Of Gas.&amp;nbsp; Here is my calculated column used to determine the customer's “Status”. The PCT_AT_FILL is the amount of gas in&amp;nbsp; the tank before delivery is due.&lt;/P&gt;&lt;P&gt;Status= IF(History[PCT_AT_FILL] &amp;lt;=0, "OOG",&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; If(History[QTY]&amp;gt;= 300, "On Time",&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;&amp;nbsp;&amp;nbsp; &amp;nbsp; IF(History[PCT_AT_FILL] &amp;gt;0 &amp;amp;&amp;amp; History[PCT_AT_FILL] &amp;lt;20, "Late",&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IF(History[PCT_AT_FILL] &amp;gt;=20 &amp;amp;&amp;amp; History[PCT_AT_FILL] &amp;lt;= 50, "On Time",&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IF(History[PCT_AT_FILL] &amp;gt; 50, "Early", "On Time")))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculated column is then used in a measure to count the rows displayed with the filtered Status.&lt;/P&gt;&lt;P&gt;Early = CALCULATE(COUNTA(History[Status]), History[PCT_AT_FILL] &amp;gt; 50 &amp;amp;&amp;amp; History[Status] &amp;lt;&amp;gt;"On Time")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The “Early” count of 47 should be 46 based on the number of rows rendered.&amp;nbsp; This in turn causes the Total to be off by 1.&lt;/P&gt;&lt;P&gt;The “Early” count seems to be the only one with the problem.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Does anyone have suggestions as to what the problem is?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bud&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 20:25:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3469731#M132465</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2023-10-10T20:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows on a Card does not agree with what is rendered.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3469815#M132473</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299232" data-lia-user-login="BudMan512" class="lia-mention lia-mention-user"&gt;BudMan512&lt;/a&gt;&amp;nbsp;The issue could be related to how the COUNTA function is used in your measure. You should try using the COUNTROWS function instead, as it is better suited for counting rows in a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Early = CALCULATE(COUNTROWS(History), History[PCT_AT_FILL] &amp;gt; 50 &amp;amp;&amp;amp; History[Status] &amp;lt;&amp;gt;“On Time”)&lt;BR /&gt;&lt;STRONG&gt;======OR&lt;/STRONG&gt;&lt;BR /&gt;Early = COUNTROWS(FILTER(History, History[PCT_AT_FILL] &amp;gt; 50 &amp;amp;&amp;amp; History[Status] &amp;lt;&amp;gt; "On Time"))&lt;BR /&gt;&lt;STRONG&gt;======OR&lt;/STRONG&gt;&lt;BR /&gt;Early = CALCULATE(COUNTROWS(History), FILTER(History, History[PCT_AT_FILL] &amp;gt; 50 &amp;amp;&amp;amp; History[Status] &amp;lt;&amp;gt; “On Time”))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These should give you an accurate count of the rows displayed with the filtered Status.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 21:18:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3469815#M132473</guid>
      <dc:creator>DallasBaba</dc:creator>
      <dc:date>2023-10-10T21:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows on a Card does not agree with what is rendered.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3471222#M132538</link>
      <description>&lt;P&gt;Hi dallasbabatunde,&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446607" data-lia-user-login="DallasBaba" class="lia-mention lia-mention-user"&gt;DallasBaba&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to the reply to my question.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestions gave me the same result that I was getting, although I did learn something about how to use the Filter function. It is like there is an invisible row being counted.&amp;nbsp; I have another branch that overcounts by 15 and the other 10 branches are correct.&lt;/P&gt;&lt;P&gt;The model seems pretty basic.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Do you have any other thoughts on the problem?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bud&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 12:59:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3471222#M132538</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2023-10-11T12:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows on a Card does not agree with what is rendered.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3471517#M132560</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299232" data-lia-user-login="BudMan512" class="lia-mention lia-mention-user"&gt;BudMan512&lt;/a&gt;&amp;nbsp;Please change the filter direction on Location &amp;amp; History &lt;STRONG&gt;both&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&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;I hope that solves the problem.&lt;BR /&gt;----&lt;BR /&gt;Another issue is data redundant because I can spot CUST_ID &amp;amp; BRANCH_NO in 3table in your model. WHY? I would like to see a remaining attribute in your customer and history table to check for data redundant, which can help improve your model performance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 15:07:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3471517#M132560</guid>
      <dc:creator>DallasBaba</dc:creator>
      <dc:date>2023-10-11T15:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows on a Card does not agree with what is rendered.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3471759#M132573</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299232" data-lia-user-login="BudMan512" class="lia-mention lia-mention-user"&gt;BudMan512&lt;/a&gt;I would like to know if the last solution works. If so, Please accept it as a solution so others can reference it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 16:54:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3471759#M132573</guid>
      <dc:creator>DallasBaba</dc:creator>
      <dc:date>2023-10-11T16:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows on a Card does not agree with what is rendered.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3472159#M132593</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446607" data-lia-user-login="DallasBaba" class="lia-mention lia-mention-user"&gt;DallasBaba&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thanks for your most recent suggestion.&amp;nbsp; I think I have partially figured out the problem though.&amp;nbsp; Sometimes after we make a delivery we need to credit the delivery back and rebill it.&amp;nbsp; So now our one delivery turns into two deliveries and one offsetting credit.&amp;nbsp; I ended up adding the Invoice Number to the row context and it rendured the second delivery which agreed with with my count.&amp;nbsp; However, the SQL query I used to load the data requested 'Qty &amp;gt;= 0', which is why the credit did not show.&amp;nbsp; My final problem is to figure out a way for the system to only count my original delivery and not the second one used in the&amp;nbsp; adjustment.&lt;/P&gt;&lt;P&gt;If you have any thoughts on that I would love to hear them.&amp;nbsp; I very much appreciate your time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 20:54:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3472159#M132593</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2023-10-11T20:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows on a Card does not agree with what is rendered.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3473564#M132661</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299232" data-lia-user-login="BudMan512" class="lia-mention lia-mention-user"&gt;BudMan512&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;To count only the original delivery, you need to distinguish between the two in your calculations. Like using a Filter context for Original Deliveries:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OriginalDeliveries = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(COUNTROWS(History), History[PCT_AT_FILL] &amp;gt; 50 &amp;amp;&amp;amp; History[Status] &amp;lt;&amp;gt; "On Time" &amp;amp;&amp;amp; History[DeliveryType] = "Original")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Note:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;The DeliveryType represents whether a record is an "Original" or an "Adjustment," and It will only count "Original" deliveries.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can also try the following measures to achieve the same result.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Early = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(COUNTROWS(History), FILTER(History, History[PCT_AT_FILL] &amp;gt; 50 &amp;amp;&amp;amp; History[Status] &amp;lt;&amp;gt; "On Time"))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If those two measures still give you an incorrect count, something else might be affecting the data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Another option is to modify your data source query to filter out duplicate deliveries, considering the Invoice Number or another unique identifier. Apply a filter condition in your SQL query to exclude the duplicate deliveries, ensuring you only load the original deliveries into your Power BI model. These will help you count the rows accurately.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ensuring that your data is properly normalized and relationships between tables are correctly defined is essential.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if this works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 13:17:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3473564#M132661</guid>
      <dc:creator>DallasBaba</dc:creator>
      <dc:date>2023-10-12T13:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows on a Card does not agree with what is rendered.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3474078#M132694</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446607" data-lia-user-login="DallasBaba" class="lia-mention lia-mention-user"&gt;DallasBaba&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 18:00:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-rows-on-a-Card-does-not-agree-with-what-is-rendered/m-p/3474078#M132694</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2023-10-12T18:00:17Z</dc:date>
    </item>
  </channel>
</rss>

