<?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 Calculate Countrows Issue wrong number displayed in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4718749#M180723</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Hello Everyone,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having issue with this calculate measure below.&amp;nbsp; It is showing me the total number of funded projects is 17 when in actual it should be &lt;STRONG&gt;12&lt;/STRONG&gt;. &amp;nbsp;Why is it doing this? I will breakdown my steps for you guys.&amp;nbsp;Is there a simpler way to count the total number of funded projects?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count of Funded projects &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Count of Funded Measure =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS('Project Summar'),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Project Summar'[Budget Status] = "Funded"&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;This is the correct table&amp;nbsp; Which shows 12 funded projects.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the correct measure I used to get it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Funding Status &amp;nbsp;(Measure)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Status Go =&lt;/P&gt;&lt;P&gt;SWITCH(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; TRUE(),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ISBLANK([Total Actual]) &amp;amp;&amp;amp; ([Total Budget]) &amp;gt; 0, "Not Started",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] = 0 &amp;amp;&amp;amp; [Total Budget] = 0, "Not Funded",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] &amp;gt; [Total Budget], "Over Funded",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] = [Total Budget], "On Budget",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] &amp;lt; [Total Budget] &amp;amp;&amp;amp; [Total Actual] &amp;gt; 0, "Funded","Unbudgeted Credit"&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When I tried to use a measure formula in my first calculation it would not let me.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This was my work around that resulted in the inaccurate number of 17 funded projects&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step One: Project Summary (Table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Project Summar =&lt;/P&gt;&lt;P&gt;SUMMARIZE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Research Capital Report',&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Research Capital Report'[Project Name],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "Total Budget", CALCULATE(SUM('Research Capital Report'[Budget Amt]), 'Research Capital Report'[Type ] = "Budget"),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "Total Actual", CALCULATE(SUM('Research Capital Report'[Total Amt]), 'Research Capital Report'[Type ] = "Actual"&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step Two: Budget Status:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Budget Status =&lt;/P&gt;&lt;P&gt;SWITCH(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; TRUE(),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ISBLANK([Total Actual]) &amp;amp;&amp;amp; [Total Budget] &amp;gt; 0, "Not Started",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] = 0 &amp;amp;&amp;amp; [Total Budget] = 0, "Not Found",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] &amp;gt; [Total Budget], "Over Funded",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] = [Total Budget], " On Budget",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] &amp;lt; [Total Budget] &amp;amp;&amp;amp; [Total Actual] &amp;gt; 0, "Funded", "Unbudgeted Credit"&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step Three: Count of Funded projects &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Count of Funded Measure =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS('Project Summar'),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Project Summar'[Budget Status] = "Funded"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is where it shows 17 projects that have been funded.&amp;nbsp; But when you look at &lt;STRONG&gt;Total Actual&lt;/STRONG&gt; and &lt;STRONG&gt;Total Budget &lt;/STRONG&gt;numbers are totally incorrect&lt;STRONG&gt;.&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you so much!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Samuel&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2025 18:44:12 GMT</pubDate>
    <dc:creator>SamuelSea</dc:creator>
    <dc:date>2025-06-03T18:44:12Z</dc:date>
    <item>
      <title>Calculate Countrows Issue wrong number displayed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4718749#M180723</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello Everyone,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having issue with this calculate measure below.&amp;nbsp; It is showing me the total number of funded projects is 17 when in actual it should be &lt;STRONG&gt;12&lt;/STRONG&gt;. &amp;nbsp;Why is it doing this? I will breakdown my steps for you guys.&amp;nbsp;Is there a simpler way to count the total number of funded projects?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count of Funded projects &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Count of Funded Measure =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS('Project Summar'),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Project Summar'[Budget Status] = "Funded"&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;This is the correct table&amp;nbsp; Which shows 12 funded projects.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the correct measure I used to get it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Funding Status &amp;nbsp;(Measure)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Status Go =&lt;/P&gt;&lt;P&gt;SWITCH(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; TRUE(),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ISBLANK([Total Actual]) &amp;amp;&amp;amp; ([Total Budget]) &amp;gt; 0, "Not Started",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] = 0 &amp;amp;&amp;amp; [Total Budget] = 0, "Not Funded",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] &amp;gt; [Total Budget], "Over Funded",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] = [Total Budget], "On Budget",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] &amp;lt; [Total Budget] &amp;amp;&amp;amp; [Total Actual] &amp;gt; 0, "Funded","Unbudgeted Credit"&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When I tried to use a measure formula in my first calculation it would not let me.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This was my work around that resulted in the inaccurate number of 17 funded projects&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step One: Project Summary (Table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Project Summar =&lt;/P&gt;&lt;P&gt;SUMMARIZE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Research Capital Report',&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Research Capital Report'[Project Name],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "Total Budget", CALCULATE(SUM('Research Capital Report'[Budget Amt]), 'Research Capital Report'[Type ] = "Budget"),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "Total Actual", CALCULATE(SUM('Research Capital Report'[Total Amt]), 'Research Capital Report'[Type ] = "Actual"&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step Two: Budget Status:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Budget Status =&lt;/P&gt;&lt;P&gt;SWITCH(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; TRUE(),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ISBLANK([Total Actual]) &amp;amp;&amp;amp; [Total Budget] &amp;gt; 0, "Not Started",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] = 0 &amp;amp;&amp;amp; [Total Budget] = 0, "Not Found",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] &amp;gt; [Total Budget], "Over Funded",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] = [Total Budget], " On Budget",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; [Total Actual] &amp;lt; [Total Budget] &amp;amp;&amp;amp; [Total Actual] &amp;gt; 0, "Funded", "Unbudgeted Credit"&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step Three: Count of Funded projects &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Count of Funded Measure =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS('Project Summar'),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Project Summar'[Budget Status] = "Funded"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is where it shows 17 projects that have been funded.&amp;nbsp; But when you look at &lt;STRONG&gt;Total Actual&lt;/STRONG&gt; and &lt;STRONG&gt;Total Budget &lt;/STRONG&gt;numbers are totally incorrect&lt;STRONG&gt;.&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you so much!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Samuel&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 18:44:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4718749#M180723</guid>
      <dc:creator>SamuelSea</dc:creator>
      <dc:date>2025-06-03T18:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Countrows Issue wrong number displayed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4718819#M180725</link>
      <description>&lt;P&gt;Are the "Total Actual" and "Total Budget" columns also measures?&amp;nbsp; If so something with these might be causing the issue as your budget status measure is accurately assigning the statuses based on your logic you have.&amp;nbsp; Something with how those totals are calculated might be causing the issue.&amp;nbsp; If you post the DAX for those that would help as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another thing you could try to fix your error above is perist your measure in a variable for this code:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The change would be:&lt;/P&gt;&lt;P&gt;Count of Funded T1 =&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR StatusGo = Research Capital Report[Status Go]&lt;BR /&gt;**or if this is not a measure**&lt;/P&gt;&lt;P&gt;VAR StatusGo = SelectedValue(Research Capital Report [Status Go])&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;COUNTROWS('Project Summar'),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;StatusGo = "Funded")&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 20:01:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4718819#M180725</guid>
      <dc:creator>d_m_LNK</dc:creator>
      <dc:date>2025-06-03T20:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Countrows Issue wrong number displayed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4718884#M180730</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="985487" data-lia-user-login="d_m_LNK" class="lia-mention lia-mention-user"&gt;d_m_LNK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;I tried your solution but kept on getting the "A Function PLACEHOLDER message”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both are measures.&lt;/P&gt;&lt;P&gt;Total Actual = Sum('Research Capital Report'[Total Amt])&lt;/P&gt;&lt;P&gt;Total Budget = Sum('Research Capital Report'[Budget Amt])&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Jun 2025 22:52:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4718884#M180730</guid>
      <dc:creator>SamuelSea</dc:creator>
      <dc:date>2025-06-03T22:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Countrows Issue wrong number displayed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4719052#M180736</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1283731" target="_self"&gt;&lt;SPAN class=""&gt;SamuelSea&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As per understanding by reading your original post:&lt;/P&gt;&lt;P&gt;The mismatch in numbers 17 vs. 12 is likely due to&amp;nbsp;row context not being properly translated into filter context&amp;nbsp;when using calculated columns and measures together.&lt;BR /&gt;&lt;BR /&gt;Instead of relying on the calculated column&amp;nbsp;Budget Status,&amp;nbsp;use the&amp;nbsp;same logic directly in your measure&amp;nbsp;using variables:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;!--  ScriptorStartFragment  --&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Count of Funded Projects =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Research Capital Report'&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Project Name&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADDCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Research Capital Report'&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Project Name&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "TotalBudget", CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Research Capital Report'&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Budget Amt&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;, 'Research Capital Report'&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Type &lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt; = "Budget"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "TotalActual", CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Research Capital Report'&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Total Amt&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;, 'Research Capital Report'&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Type &lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt; = "Actual"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;TotalActual&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;TotalBudget&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;TotalActual&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; 0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;!--  ScriptorEndFragment  --&gt;&lt;/SPAN&gt;&lt;BR /&gt;Hope the above DAX expression may help you.&lt;/P&gt;&lt;P&gt;Please let me know if you have further questions.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too.&amp;nbsp;And if you found it useful, a quick "Kudos" is always appreciated, thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maruthi&amp;nbsp;&lt;/P&gt;&lt;P&gt;LinkedIn -&amp;nbsp;&lt;A href="http://www.linkedin.com/in/maruthi-siva-prasad/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.linkedin.com/in/maruthi-siva-prasad/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X&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;&lt;A href="https://x.com/maruthisp" target="_blank" rel="nofollow noopener noreferrer"&gt;Maruthi Siva Prasad - (@MaruthiSP) / X&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 04:33:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4719052#M180736</guid>
      <dc:creator>maruthisp</dc:creator>
      <dc:date>2025-06-04T04:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Countrows Issue wrong number displayed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4719495#M180744</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1283731" data-lia-user-login="SamuelSea" class="lia-mention lia-mention-user"&gt;SamuelSea&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for posting your query in the Microsoft Fabric Community.&amp;nbsp; I have successfully recreated your scenario using the sample dataset and logic as described in your requirements. I identified the key problem&amp;nbsp;Budget Status was a measure, which made it difficult for Power BI to filter rows correctly within CALCULATE().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To fix this, I switched&lt;STRONG&gt; Budget Status to a calculated column&lt;/STRONG&gt;, ensuring accurate row level filtering. Once I applied this change and corrected the measure logic, I got the expected result&amp;nbsp;5 funded projects, just as you anticipated.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;FYI:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sample Data:&lt;/STRONG&gt;&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;I’ve attached a .pbix file with the fully working version for you to review. Feel free to check it out, and let me know if you need any further refinements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you all for your inputs to the community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If my response solved your query, please mark it as the&amp;nbsp;&lt;STRONG&gt;Accepted solution&lt;/STRONG&gt;&amp;nbsp;to help others find it easily. And if my answer was helpful, I'd really appreciate a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 09:05:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Countrows-Issue-wrong-number-displayed/m-p/4719495#M180744</guid>
      <dc:creator>V-yubandi-msft</dc:creator>
      <dc:date>2025-06-04T09:05:09Z</dc:date>
    </item>
  </channel>
</rss>

