<?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: Running Total Works Referencing Just 1 table but breaks when I add a relationship to another? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2670666#M79629</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417546" data-lia-user-login="Barthel" class="lia-mention lia-mention-user"&gt;Barthel&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You are 100% correct. In general using REMOVEFILTERS + VALUES is the best option when creating measures.&lt;BR /&gt;Actually&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418667" data-lia-user-login="Brotedo" class="lia-mention lia-mention-user"&gt;Brotedo&lt;/a&gt;&amp;nbsp;is using ALLEXCEPT as a table not as a CALCULATE modifier which is not a good practice&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jul 2022 15:10:45 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-07-30T15:10:45Z</dc:date>
    <item>
      <title>Running Total Works Referencing Just 1 table but breaks when I add a relationship to another?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2670090#M79580</link>
      <description>&lt;P&gt;I'm using a matrix, and want sales values to sum along columns that represent a rolling 12 month view. My matrix has two rows for User and Team that should filter the data. Originally, the table with my sales data didn't have user and team information, it just had a UserId with a relationship to a UserKey table that connected that Id to Name and Team. I tried the following code to make a running total with that setup:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RT Test = 
    Var DateMax = max('Planning Monthly'[DateDiff])
Return
    sumx(
        filter(
            allexcept('Planning Monthly','Planning Monthly'[UserId]), 'Planning Monthly'[DateDiff]&amp;lt;= DateMax),
                [Rolling12Value])&lt;/LI-CODE&gt;&lt;P&gt;UserId is the column that creates the relationship, but this didn't work. It did create a running total, but it just ignored the row values (gave the same running total for each user/team combo).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I pulled the UserName and Team into my original table using Lookupvalue and modified the code to this and it works:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RT Test = 
    Var DateMax = max('Planning Monthly'[DateDiff])
Return
    sumx(
        filter(
            allexcept('Planning Monthly','Planning Monthly'[UserName],'Planning Monthly'[Team]), 'Planning Monthly'[DateDiff]&amp;lt;= DateMax),
                [Rolling12Value])
                        &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I'd really rather keep using the two tables with the relationship, rather than pulling name and team into my sales table, but the only code I've gotten to work just uses the one table.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 18:18:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2670090#M79580</guid>
      <dc:creator>Brotedo</dc:creator>
      <dc:date>2022-07-29T18:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total Works Referencing Just 1 table but breaks when I add a relationship to another?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2670598#M79627</link>
      <description>&lt;P&gt;Hey,&lt;BR /&gt;&lt;BR /&gt;In some cases, especially with matrices, ALLEXCEPT does not work properly. That might be the cause of your problem. Maybe this will work:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;RT Test =
VAR DateMax =
    MAX ( 'Planning Monthly'[DateDiff] )
RETURN
    SUMX (
        CALCULATETABLE (
            'Planning Monthly',
            REMOVEFILTERS ( 'Planning Monthly' ),
            VALUES ( 'Planning Monthly'[UserId] ),
            'Planning Monthly'[DateDiff] &amp;lt;= DateMax
        ),
        [Rolling12Value]
    )&lt;/LI-CODE&gt;&lt;P&gt;Read this article for more info:&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/" target="_blank"&gt;https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2022 13:08:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2670598#M79627</guid>
      <dc:creator>Barthel</dc:creator>
      <dc:date>2022-07-30T13:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total Works Referencing Just 1 table but breaks when I add a relationship to another?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2670666#M79629</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417546" data-lia-user-login="Barthel" class="lia-mention lia-mention-user"&gt;Barthel&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You are 100% correct. In general using REMOVEFILTERS + VALUES is the best option when creating measures.&lt;BR /&gt;Actually&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418667" data-lia-user-login="Brotedo" class="lia-mention lia-mention-user"&gt;Brotedo&lt;/a&gt;&amp;nbsp;is using ALLEXCEPT as a table not as a CALCULATE modifier which is not a good practice&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2022 15:10:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2670666#M79629</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-30T15:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total Works Referencing Just 1 table but breaks when I add a relationship to another?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2672956#M79773</link>
      <description>&lt;P&gt;Thank you so much! This works, and it updates a lot faster than what I had originally used as well!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 12:46:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Works-Referencing-Just-1-table-but-breaks-when-I/m-p/2672956#M79773</guid>
      <dc:creator>Brotedo</dc:creator>
      <dc:date>2022-08-01T12:46:29Z</dc:date>
    </item>
  </channel>
</rss>

