<?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: How to avoid row interaction in a DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4657331#M178319</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1260466" data-lia-user-login="LaurenceA" class="lia-mention lia-mention-user"&gt;LaurenceA&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Microsoft Fabric Forum Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like the issue arises when adding the Sales Rep field to your table. The measure you created correctly calculates sales for the last two years, but when Sales Rep is added, the visual breaks into multiple rows per customer due to the measure being re-evaluated in the context of each rep.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the revised Dax Measure&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;_InvoiceNetAmountCAD_Sum_Last2years =
VAR _ThisYear = YEAR(TODAY())
VAR _LastYear = _ThisYear - 1
VAR _SecondToLastYear = _ThisYear - 2

VAR _NetAmountLastYear =
    CALCULATE(
        [_ConsolidatedInvoiceNetAmountCAD_Sum],
        FILTER(
            ALL('Billing Date'),
            YEAR('Billing Date'[Billing Date]) = _LastYear
        ),
        REMOVEFILTERS('Sales Rep')
    )

VAR _NetAmountSecondToLastYear =
    CALCULATE(
        [_ConsolidatedInvoiceNetAmountCAD_Sum],
        FILTER(
            ALL('Billing Date'),
            YEAR('Billing Date'[Billing Date]) = _SecondToLastYear
        ),
        REMOVEFILTERS('Sales Rep')
    )

RETURN
    _NetAmountLastYear + _NetAmountSecondToLastYear
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;If this solution doesn’t fully resolve the issue or you’re seeing unexpected behavior in the visual, would you mind sharing a small sample of your dataset?&lt;/STRONG&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;If this post&amp;nbsp;helps, then please give us ‘Kudos’ and consider&amp;nbsp;Accept it as a solution&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Apr 2025 11:03:52 GMT</pubDate>
    <dc:creator>v-saisrao-msft</dc:creator>
    <dc:date>2025-04-17T11:03:52Z</dc:date>
    <item>
      <title>How to avoid row interaction in a DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4654554#M178184</link>
      <description>&lt;P&gt;I have made a DAX measure that calculate the sales of the last 2 years.&amp;nbsp;&lt;BR /&gt;I use this measure in a table and filter to isolated only the customer with X$ or less.&amp;nbsp;So far so Good.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I add the Sales reps it will return the line for each sales rep. wich I don't want. Is there a wat to avoid this.&amp;nbsp;&lt;BR /&gt;My goal is to see which client did not buy for the last two year and did buy this year and to see the sales rape associated with the current year sales.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is the DAX&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;_InvoiceNetAmountCAD_Sum_Last2years =&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR &lt;/SPAN&gt;&lt;SPAN&gt;_ThisYear&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;() ) &lt;/SPAN&gt;&lt;SPAN&gt;-- Retourne l'année en cours (Ex: 2025)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR &lt;/SPAN&gt;&lt;SPAN&gt;_LastYear&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;_ThisYear&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;1 &lt;/SPAN&gt;&lt;SPAN&gt;-- Retourne l'année dernière basé sur l'année en cours (Ex: 2024)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR &lt;/SPAN&gt;&lt;SPAN&gt;_SecondToLastYear&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;_ThisYear&lt;/SPAN&gt;&lt;SPAN&gt; -&lt;/SPAN&gt;&lt;SPAN&gt;2 &lt;/SPAN&gt;&lt;SPAN&gt;-- Retourne l'avant année dernière basé sur l'année en cours ( Ex: 2023)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR &lt;/SPAN&gt;&lt;SPAN&gt;_NetAmountLastYear&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[_ConsolidatedInvoiceNetAmountCAD_Sum]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;-- Somme le Invoice Net Amount CAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Billing Date'&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Billing Date'[Billing Date]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;_LastYear &lt;/SPAN&gt;&lt;SPAN&gt;-- Si l'année de facturation est égale à celle de l'année dernière&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR &lt;/SPAN&gt;&lt;SPAN&gt;_NetAmountSecondToLastYear&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[_ConsolidatedInvoiceNetAmountCAD_Sum]&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-- Somme le Invoice Net Amount CAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'Billing Date'&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Billing Date'[Billing Date]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;_SecondToLastYear &lt;/SPAN&gt;&lt;SPAN&gt;-- Si l'année de facturation est égale à celle d'il y a deux an&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;_NetAmountLastYear&lt;/SPAN&gt;&lt;SPAN&gt; +&lt;/SPAN&gt;&lt;SPAN&gt;_NetAmountSecondToLastYear &lt;/SPAN&gt;&lt;SPAN&gt;-- Retourne le Invoice Net AMount CAD des deux dernières années&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 19:23:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4654554#M178184</guid>
      <dc:creator>LaurenceA</dc:creator>
      <dc:date>2025-04-15T19:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid row interaction in a DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4654644#M178189</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1260466" data-lia-user-login="LaurenceA" class="lia-mention lia-mention-user"&gt;LaurenceA&lt;/a&gt;&amp;nbsp;There is probably a way. However, the right answer is going to be heavily dependent on your semantic model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, having trouble following, can you post sample data as text and expected output?&lt;BR /&gt;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 21:10:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4654644#M178189</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2025-04-15T21:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid row interaction in a DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4657331#M178319</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1260466" data-lia-user-login="LaurenceA" class="lia-mention lia-mention-user"&gt;LaurenceA&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Microsoft Fabric Forum Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like the issue arises when adding the Sales Rep field to your table. The measure you created correctly calculates sales for the last two years, but when Sales Rep is added, the visual breaks into multiple rows per customer due to the measure being re-evaluated in the context of each rep.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the revised Dax Measure&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;_InvoiceNetAmountCAD_Sum_Last2years =
VAR _ThisYear = YEAR(TODAY())
VAR _LastYear = _ThisYear - 1
VAR _SecondToLastYear = _ThisYear - 2

VAR _NetAmountLastYear =
    CALCULATE(
        [_ConsolidatedInvoiceNetAmountCAD_Sum],
        FILTER(
            ALL('Billing Date'),
            YEAR('Billing Date'[Billing Date]) = _LastYear
        ),
        REMOVEFILTERS('Sales Rep')
    )

VAR _NetAmountSecondToLastYear =
    CALCULATE(
        [_ConsolidatedInvoiceNetAmountCAD_Sum],
        FILTER(
            ALL('Billing Date'),
            YEAR('Billing Date'[Billing Date]) = _SecondToLastYear
        ),
        REMOVEFILTERS('Sales Rep')
    )

RETURN
    _NetAmountLastYear + _NetAmountSecondToLastYear
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;If this solution doesn’t fully resolve the issue or you’re seeing unexpected behavior in the visual, would you mind sharing a small sample of your dataset?&lt;/STRONG&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;If this post&amp;nbsp;helps, then please give us ‘Kudos’ and consider&amp;nbsp;Accept it as a solution&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 11:03:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4657331#M178319</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-04-17T11:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid row interaction in a DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4660260#M178457</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="1260466" data-lia-user-login="LaurenceA" class="lia-mention lia-mention-user"&gt;LaurenceA&lt;/a&gt;,&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>Mon, 21 Apr 2025 04:29:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4660260#M178457</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-04-21T04:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid row interaction in a DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4666038#M178707</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1260466" data-lia-user-login="LaurenceA" class="lia-mention lia-mention-user"&gt;LaurenceA&lt;/a&gt;,&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>Thu, 24 Apr 2025 06:44:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4666038#M178707</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-04-24T06:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid row interaction in a DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4669828#M178860</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1260466" data-lia-user-login="LaurenceA" class="lia-mention lia-mention-user"&gt;LaurenceA&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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>Mon, 28 Apr 2025 04:14:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-avoid-row-interaction-in-a-DAX/m-p/4669828#M178860</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-04-28T04:14:42Z</dc:date>
    </item>
  </channel>
</rss>

