<?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 Total row and column ignore the condition in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4695971#M179847</link>
    <description>&lt;P&gt;In a matrix I'm using the following measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;m =SUMX(
     VALUES('abc'[RRFI_ID])
    ,CALCULATE(DISTINCTCOUNT('abc'[ID]))
    )&lt;/LI-CODE&gt;&lt;P&gt;It works fine in matrix table and shows correct number in Total row and column. But when I add IF condition as follow:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;m =
Var _c = SUMX(
     VALUES('abc'[RRFI_ID])
    ,CALCULATE(DISTINCTCOUNT('abc'[ID]))
    )
Return IF(_c&amp;gt;1, _c, blank())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the Total row and column doesn't show correct number. Somehow the Total row and column ignore the condition in IF statement.&lt;/P&gt;&lt;P&gt;how can I change the measure to get correct number in Total ro and column in matrix?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 May 2025 12:14:36 GMT</pubDate>
    <dc:creator>Trodo7377</dc:creator>
    <dc:date>2025-05-16T12:14:36Z</dc:date>
    <item>
      <title>Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4695971#M179847</link>
      <description>&lt;P&gt;In a matrix I'm using the following measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;m =SUMX(
     VALUES('abc'[RRFI_ID])
    ,CALCULATE(DISTINCTCOUNT('abc'[ID]))
    )&lt;/LI-CODE&gt;&lt;P&gt;It works fine in matrix table and shows correct number in Total row and column. But when I add IF condition as follow:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;m =
Var _c = SUMX(
     VALUES('abc'[RRFI_ID])
    ,CALCULATE(DISTINCTCOUNT('abc'[ID]))
    )
Return IF(_c&amp;gt;1, _c, blank())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the Total row and column doesn't show correct number. Somehow the Total row and column ignore the condition in IF statement.&lt;/P&gt;&lt;P&gt;how can I change the measure to get correct number in Total ro and column in matrix?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 12:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4695971#M179847</guid>
      <dc:creator>Trodo7377</dc:creator>
      <dc:date>2025-05-16T12:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4696291#M179864</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="790817" data-lia-user-login="Trodo7377" class="lia-mention lia-mention-user"&gt;Trodo7377&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason your total row in the matrix isn't working as expected is because Power BI evaluates totals using the entire context of the visual, not by simply summing the visible rows. When you use an IF statement that returns BLANK() for certain rows, those blank values are ignored in the total, but the logic inside the IF is not applied the same way at the total level. To ensure the condition _c &amp;gt; 1 is applied both to the individual rows and the total, you need to explicitly apply the filtering logic across all rows using a table expression. Here's how you can rewrite your measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;m =
VAR _table =
    ADDCOLUMNS(
        VALUES('abc'[RRFI_ID]),
        "Count", CALCULATE(DISTINCTCOUNT('abc'[ID]))
    )
RETURN
SUMX(
    FILTER(_table, [Count] &amp;gt; 1),
    [Count]
)
&lt;/LI-CODE&gt;
&lt;P&gt;This measure constructs a table of RRFI_ID values along with their corresponding distinct counts of ID. It then filters that table to keep only the rows where the count is greater than 1 and sums those values. This ensures consistent behavior in both individual rows and total rows in the matrix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 16:04:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4696291#M179864</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2025-05-16T16:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4697533#M179916</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/790817" target="_self"&gt;&lt;SPAN class=""&gt;Trodo7377&lt;/SPAN&gt;&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;Can you try to go through the attachedpbix file?&lt;BR /&gt;&lt;A href="https://cloudbiexpert-my.sharepoint.com/:u:/p/maruthi/EY5O556H_d5EqfxHWwkmAdYBjVU5VSQBScc1FDXTe12U9Q?e=zJVRtU" target="_blank" rel="noopener"&gt;Total row and column ignore the condition.pbix&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&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>Mon, 19 May 2025 03:35:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4697533#M179916</guid>
      <dc:creator>maruthisp</dc:creator>
      <dc:date>2025-05-19T03:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4697950#M179940</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608865" data-lia-user-login="DataNinja777" class="lia-mention lia-mention-user"&gt;DataNinja777&lt;/a&gt;&amp;nbsp; for your reply. I tried it but it doesn't show anything in matrix table.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 07:23:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4697950#M179940</guid>
      <dc:creator>Trodo7377</dc:creator>
      <dc:date>2025-05-19T07:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4697970#M179942</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="526044" data-lia-user-login="maruthisp" class="lia-mention lia-mention-user"&gt;maruthisp&lt;/a&gt;&amp;nbsp; for your suggestion. The result table(matrix) show nothing and it is empty.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 07:35:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4697970#M179942</guid>
      <dc:creator>Trodo7377</dc:creator>
      <dc:date>2025-05-19T07:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4710369#M180394</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="790817" data-lia-user-login="Trodo7377" class="lia-mention lia-mention-user"&gt;Trodo7377&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Please try below &lt;SPAN&gt;measure, it may help you.&lt;BR /&gt;&lt;BR /&gt;m =&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'abc'[RRFI_ID] ),&lt;BR /&gt;VAR _c = CALCULATE ( DISTINCTCOUNT ( 'abc'[ID] ) )&lt;BR /&gt;RETURN IF ( _c &amp;gt; 1, _c, BLANK () )&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;If this information is helpful, please&amp;nbsp;&lt;STRONG&gt;“Accept as solution”&lt;/STRONG&gt;&amp;nbsp;and give a&amp;nbsp;&lt;STRONG&gt;"kudos"&lt;/STRONG&gt;&amp;nbsp;to assist other community members in resolving similar issues more efficiently.&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 11:42:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4710369#M180394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-28T11:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4714987#M180596</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="790817" data-lia-user-login="Trodo7377" class="lia-mention lia-mention-user"&gt;Trodo7377&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 11:11:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4714987#M180596</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-31T11:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4719679#M180750</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="790817" data-lia-user-login="Trodo7377" class="lia-mention lia-mention-user"&gt;Trodo7377&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?&lt;BR /&gt;If you've already resolved the issue, you can mark the helpful reply as a "solution" so others know that the question has been answered and help other people in the community. Thank you again for your cooperation!&lt;BR /&gt;If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:03:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4719679#M180750</guid>
      <dc:creator>v-sgandrathi</dc:creator>
      <dc:date>2025-06-04T11:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Total row and column ignore the condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4724088#M180950</link>
      <description>&lt;P&gt;&lt;SPAN data-teams="true"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="790817" data-lia-user-login="Trodo7377" class="lia-mention lia-mention-user"&gt;Trodo7377&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please &lt;STRONG&gt;Accept it as a solution&lt;/STRONG&gt; and give it a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;' so others can find it easily.&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jun 2025 16:41:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-row-and-column-ignore-the-condition/m-p/4724088#M180950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-07T16:41:56Z</dc:date>
    </item>
  </channel>
</rss>

