<?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: Calculating cumulative total across categories in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4332463#M172000</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="901076" data-lia-user-login="tomerb" class="lia-mention lia-mention-user"&gt;tomerb&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;What are your expected results?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Community Support Team_ Scott Chang&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2024 07:41:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-12-17T07:41:33Z</dc:date>
    <item>
      <title>Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4328778#M171841</link>
      <description>&lt;P&gt;I'm using this to calculate cumulative/running total across categories, where the sum of each category is added to the next category in line, based on a pre-defined order:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Total = 
VAR CurrentCategoryOrder = MAX(TABLE[CATEGORY_ORDER])
RETURN
CALCULATE(
    SUM(TABLE[VALUE]),
    FILTER(
        ALL(TABLE[CATEGORY], TABLE[CATEGORY_ORDER]),
        TABLE[CATEGORY_ORDER] &amp;lt;= CurrentCategoryOrder
    )
)&lt;/LI-CODE&gt;&lt;P&gt;This works most of the time, except for when no data for a category exists for a specific month, in which case, instead of the cell showing just the sum of all previous categories, it is showing 0.&lt;/P&gt;&lt;P&gt;Any suggestions on how to handle this correctly?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 23:17:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4328778#M171841</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-13T23:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4328840#M171845</link>
      <description>&lt;P&gt;To report on things that are not there you need to cross join disconnected tables and use measures.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 01:42:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4328840#M171845</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-14T01:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329119#M171849</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but please try something like below whether it works.&lt;BR /&gt;I experimented by using the attached pbix file.&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;&lt;A href="https://learn.microsoft.com/en-us/dax/window-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;WINDOW function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Running Total = 
CALCULATE (
    SUM ( 'Table'[value] ),
    WINDOW (
        1,
        ABS,
        0,
        REL,
        ALL ( 'Table' ),
        ORDERBY ( 'Table'[date], ASC, 'Table'[category_order], ASC ),
        ,
        ,
        MATCHBY ( 'Table'[category_order], 'Table'[date] )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 10:17:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329119#M171849</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-12-14T10:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329266#M171853</link>
      <description>&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;Do you mean I should create a helper table that has all the categories and their mapped order, then join that with the data table I have? If so, can you point me to a documentation, or some other data point that help me get started?&lt;BR /&gt;On that matter, perhaps it's easire to go back to the data ingestion pipeline, and add dummy items for months that have "missing" data?&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 14:14:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329266#M171853</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-14T14:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329267#M171854</link>
      <description>&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;I looked at the file you shared. In your example table a value exists for the entire set of categories for each month. This means that it might be that for a certain month category X has the value 0, in this case the running total indeed will get calculated.&lt;/P&gt;&lt;P&gt;However, in my case, I have missing categories for some months. This means that category X doesn't exist for that month, and in this case the running total will not get added to that month and category - I validated this in your dataset by removing the last row from the table.&lt;/P&gt;&lt;P&gt;Perhaps something along the line of what&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;is suggesting is the only way to go?&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 14:20:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329267#M171854</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-14T14:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329420#M171862</link>
      <description>&lt;P&gt;adding dummy data is not a preferred approach in most cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 01:34:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329420#M171862</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-15T01:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329548#M171867</link>
      <description>&lt;P&gt;Please see the &lt;A href="https://drive.google.com/file/d/1-JAuESyseYCwvMCDPYzh4J-sz5fR0_dy/view?usp=sharing" target="_self"&gt;this&lt;/A&gt; file, based on&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;reply, with a modified measure to match the one I'm using.&lt;/P&gt;&lt;P&gt;Basically, when all the categories for all months exist in the data set, there's no issue, as shown here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But if in one of the months an entry with one category is missing comletely, the data for that cell will be missing too, and this is what I get:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In this case, I removed the last row from the generated table, which means that category 'd' doesn't exist in the dataset for December. What I expect to see instead of a blank cell, is the value 16, since this is the running total for that date.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 09:46:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329548#M171867</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-15T09:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329553#M171868</link>
      <description>&lt;P&gt;It looks like I accidentally replied to my own thread, instead of your comment. Please find my response &lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329548/highlight/true#M171867" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 09:55:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329553#M171868</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-15T09:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329838#M171877</link>
      <description>&lt;P&gt;Why would you expect 21?&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;</description>
      <pubDate>Mon, 16 Dec 2024 00:25:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4329838#M171877</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-16T00:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4330304#M171892</link>
      <description>&lt;P&gt;I would not expect 21, I excpet 16 instead of an empty cell.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 07:29:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4330304#M171892</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-16T07:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4331979#M171983</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="901076" data-lia-user-login="tomerb" class="lia-mention lia-mention-user"&gt;tomerb&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;lbendlin seems to have solved the problem, and if nothing else, you can mark his solution as a solution for other members to find.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Community Support Team_ Scott Chang&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 02:58:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4331979#M171983</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-17T02:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4332446#M171999</link>
      <description>&lt;P&gt;Unless I'm missing something, this issue is not solved yet. Please point me to the comment you think provide a solution.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 07:37:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4332446#M171999</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-17T07:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4332463#M172000</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="901076" data-lia-user-login="tomerb" class="lia-mention lia-mention-user"&gt;tomerb&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;What are your expected results?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Community Support Team_ Scott Chang&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 07:41:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4332463#M172000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-17T07:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4332712#M172006</link>
      <description>&lt;P&gt;My apologies. I missed the fact that&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;attached a file and a screenshot, and just referred to his comment. I see the solution provided now.&lt;/P&gt;&lt;P&gt;This is a great answer, thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;. The issue I have with it is that it forces me to use the static table in the Rows section of the table, which doesn't work with real data. Any suggestion on how to cope with that?&lt;BR /&gt;To provide more info about the model, the main table ('Table' in our example) holds multiple columns which form a hierarchy I use in the Rows section of the matrix. If I mix the categories from Table2 with this data, the data gets duplicated in the table.&lt;/P&gt;&lt;P&gt;Does it mean that I'll need to duplicate the data from the columns I need? This means that effectively I'll need to duplicate the entire data table, and all just for the table to act reasonably. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 09:24:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4332712#M172006</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-17T09:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4333042#M172028</link>
      <description>&lt;P&gt;Please provide sample data &lt;STRONG&gt;that fully covers your issue&lt;/STRONG&gt;.&lt;BR /&gt;Please show the expected outcome based on the sample data you provided.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 12:26:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4333042#M172028</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-17T12:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating cumulative total across categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4334913#M172114</link>
      <description>&lt;P&gt;I will mark this thread as solved, and will create a new one with the requested data, as it might be a bit of a variation from the initial question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 10:55:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-cumulative-total-across-categories/m-p/4334913#M172114</guid>
      <dc:creator>tomerb</dc:creator>
      <dc:date>2024-12-18T10:55:01Z</dc:date>
    </item>
  </channel>
</rss>

