<?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: using Virtual tables to get running total in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4716045#M180635</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just a gentle reminder&amp;nbsp; has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as &lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt;, or feel free to share your own if you found a different fix.&lt;/P&gt;
&lt;P&gt;This not only closes the loop on your query but also helps others in the community solve similar issues faster.&lt;/P&gt;
&lt;P&gt;Thank you for your time and feedback!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Prasanna Kumar&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jun 2025 05:39:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-06-02T05:39:22Z</dc:date>
    <item>
      <title>using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4697984#M179943</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would like to use virtual table to have a running sum on measure delta like matrix below.&lt;/P&gt;&lt;P&gt;Delta works fine. is based on measure 1 and 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure 2 is special: data depends on calendar!YearMonth:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;data previous month (202504) is something else compared to current month and later&lt;/P&gt;&lt;P&gt;YearMonth are also columns in matrix.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Should be&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;202504&lt;/TD&gt;&lt;TD&gt;202505&lt;/TD&gt;&lt;TD&gt;202506&lt;/TD&gt;&lt;TD&gt;202507&lt;/TD&gt;&lt;TD&gt;202508&lt;/TD&gt;&lt;TD&gt;202509&lt;/TD&gt;&lt;TD&gt;202510&lt;/TD&gt;&lt;TD&gt;202511&lt;/TD&gt;&lt;TD&gt;202512&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;measure1&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&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D&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;measure2&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;measure delta&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;running total&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;150&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;250&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;350&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;450&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;550&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;650&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;750&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;850&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code below shows me correct running total but I can not use it as a measure.&lt;/P&gt;&lt;P&gt;It always shows me delta instead of running total.&lt;/P&gt;&lt;P&gt;How can I use 'running total' in my measure ?&lt;/P&gt;&lt;P&gt;And also, if any selections in PROD and GEO dimension tables, will these be reflected in this measure, using virtual tables ? Or should I capture selection in the measure ?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TableRunningTotal = 
VAR curM = VALUE(CONCATENATE(YEAR(now()), FORMAT(MONTH(now()),"00")) )
VAR prevM = IF(MONTH(today())=1,
    VALUE(CONCATENATE(YEAR(today())-1, "12")),
    VALUE(CONCATENATE(YEAR(today()), FORMAT(MONTH(TODAY())-1,"00")))
)

VAR T1 = SUMMARIZE(
        FILTER(ALL(DATA),VALUE([Month]) &amp;gt;= prevM), 
        'Calendar'[YearMonth],
        "measure1", CALCULATE(sum(DATA[Value]), DATA[Measure] = "1"),
        "measure_X", CALCULATE(sum(DATA[Value]), DATA[Measure] = "X"),
        "measure_Y", CALCULATE(sum(DATA[Value]), DATA[Measure] = "Y"),
    )
VAR T2 = ADDCOLUMNS(T1, "measure2", if(VALUE([YearMonth]) &amp;lt; curM, [measure_X], [measure_Y]) )
VAR T3 = ADDCOLUMNS(T2, "Delta", [measure1]-[ measure2] )
VAR T4 = ADDCOLUMNS(T3,"RunningTotal", SUMX(FILTER(T3, [YearMonth]&amp;lt;=EARLIER([YearMonth])), [Delta]) )
RETURN
     --T4 : shows in table view (create table) ==&amp;gt; correct running total
     --SUMX(T4,[RunningTotal]) : shows only delta’s per YearMonth
     --MAXX(T4,[RunningTotal]) : shows only delta’s per YearMonth
     --SELECTCOLUMNS(T4," ", [RunningTotal]) : shows only delta’s per YearMonth&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 07:44:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4697984#M179943</guid>
      <dc:creator>BIuser09</dc:creator>
      <dc:date>2025-05-19T07:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4698014#M179947</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;&amp;nbsp;,Create a measure for the delta calculation.&lt;/P&gt;
&lt;P&gt;Measure Delta = &lt;BR /&gt;VAR curM = VALUE(CONCATENATE(YEAR(NOW()), FORMAT(MONTH(NOW()), "00")))&lt;BR /&gt;VAR prevM = IF(MONTH(TODAY()) = 1,&lt;BR /&gt;VALUE(CONCATENATE(YEAR(TODAY()) - 1, "12")),&lt;BR /&gt;VALUE(CONCATENATE(YEAR(TODAY()), FORMAT(MONTH(TODAY()) - 1, "00")))&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR T1 = SUMMARIZE(&lt;BR /&gt;FILTER(ALL(DATA), VALUE([Month]) &amp;gt;= prevM), &lt;BR /&gt;'Calendar'[YearMonth],&lt;BR /&gt;"measure1", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "1"),&lt;BR /&gt;"measure_X", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "X"),&lt;BR /&gt;"measure_Y", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "Y")&lt;BR /&gt;)&lt;BR /&gt;VAR T2 = ADDCOLUMNS(T1, "measure2", IF(VALUE([YearMonth]) &amp;lt; curM, [measure_X], [measure_Y]))&lt;BR /&gt;VAR T3 = ADDCOLUMNS(T2, "Delta", [measure1] - [measure2])&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX(T3, [Delta])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now create one for running total&lt;/P&gt;
&lt;P&gt;Running Total = &lt;BR /&gt;VAR curM = VALUE(CONCATENATE(YEAR(NOW()), FORMAT(MONTH(NOW()), "00")))&lt;BR /&gt;VAR prevM = IF(MONTH(TODAY()) = 1,&lt;BR /&gt;VALUE(CONCATENATE(YEAR(TODAY()) - 1, "12")),&lt;BR /&gt;VALUE(CONCATENATE(YEAR(TODAY()), FORMAT(MONTH(TODAY()) - 1, "00")))&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR T1 = SUMMARIZE(&lt;BR /&gt;FILTER(ALL(DATA), VALUE([Month]) &amp;gt;= prevM), &lt;BR /&gt;'Calendar'[YearMonth],&lt;BR /&gt;"measure1", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "1"),&lt;BR /&gt;"measure_X", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "X"),&lt;BR /&gt;"measure_Y", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "Y")&lt;BR /&gt;)&lt;BR /&gt;VAR T2 = ADDCOLUMNS(T1, "measure2", IF(VALUE([YearMonth]) &amp;lt; curM, [measure_X], [measure_Y]))&lt;BR /&gt;VAR T3 = ADDCOLUMNS(T2, "Delta", [measure1] - [measure2])&lt;BR /&gt;VAR T4 = ADDCOLUMNS(T3, "RunningTotal", &lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(T3, [YearMonth] &amp;lt;= EARLIER([YearMonth])), &lt;BR /&gt;[Delta]&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;MAXX(T4, [RunningTotal])&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 08:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4698014#M179947</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-05-19T08:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4698536#M179976</link>
      <description>&lt;P&gt;Thanks for the effort, but you split the code into 2 separate measures and you don't reference the 1st one in the second measure.&lt;/P&gt;&lt;P&gt;This does not work.&lt;BR /&gt;Or am I misunderstanding your answer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Furthermore, the selection in dimension tables are not reflected in the result.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 12:56:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4698536#M179976</guid>
      <dc:creator>BIuser09</dc:creator>
      <dc:date>2025-05-19T12:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4699195#M180002</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to the Microsoft Fabric Forum Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try Using fallowing Dax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Running Total Delta = &lt;BR /&gt;VAR CurrentYearMonth = SELECTEDVALUE('Calendar'[YearMonth])&lt;BR /&gt;VAR AllYearMonths =&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED('Calendar'[YearMonth]),&lt;BR /&gt;'Calendar'[YearMonth] &amp;lt;= CurrentYearMonth&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR RunningSum =&lt;BR /&gt;SUMX(&lt;BR /&gt;AllYearMonths,&lt;BR /&gt;VAR YM = 'Calendar'[YearMonth]&lt;BR /&gt;VAR Measure1 =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(DATA[Value]),&lt;BR /&gt;DATA[Measure] = "1",&lt;BR /&gt;'Calendar'[YearMonth] = YM&lt;BR /&gt;)&lt;BR /&gt;VAR Measure2 =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;IF(&lt;BR /&gt;YM &amp;lt; VALUE(FORMAT(TODAY(), "YYYYMM")),&lt;BR /&gt;SUM(DATA[Value]),&lt;BR /&gt;BLANK()&lt;BR /&gt;),&lt;BR /&gt;DATA[Measure] = "X"&lt;BR /&gt;)&lt;BR /&gt;+&lt;BR /&gt;CALCULATE(&lt;BR /&gt;IF(&lt;BR /&gt;YM &amp;gt;= VALUE(FORMAT(TODAY(), "YYYYMM")),&lt;BR /&gt;SUM(DATA[Value]),&lt;BR /&gt;BLANK()&lt;BR /&gt;),&lt;BR /&gt;DATA[Measure] = "Y"&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;Measure1 - Measure2&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;RunningSum&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this helped, please mark the response as the accepted solution and give it a thumbs-up so others can benefit too.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Prasanna Kumar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 04:16:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4699195#M180002</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-20T04:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4699611#M180024</link>
      <description>&lt;P&gt;Thanks, this works.&lt;/P&gt;&lt;P&gt;However, it is not using virtual table I pasted above.&lt;/P&gt;&lt;P&gt;was trying to understand the virtual table and using it in a measure&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 07:58:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4699611#M180024</guid>
      <dc:creator>BIuser09</dc:creator>
      <dc:date>2025-05-20T07:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4701120#M180075</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;Try this dax measure with virtual table&lt;/P&gt;
&lt;P&gt;Running Total Delta = &lt;BR /&gt;VAR CurrentYM = SELECTEDVALUE('Calendar'[YearMonth])&lt;/P&gt;
&lt;P&gt;VAR curM = VALUE(FORMAT(TODAY(), "YYYYMM"))&lt;BR /&gt;VAR prevM = VALUE(FORMAT(EDATE(TODAY(), -1), "YYYYMM"))&lt;/P&gt;
&lt;P&gt;VAR T1 =&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Calendar'[YearMonth], DATA),&lt;BR /&gt;'Calendar'[YearMonth] &amp;gt;= prevM&lt;BR /&gt;),&lt;BR /&gt;'Calendar'[YearMonth],&lt;BR /&gt;"measure1", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "1"),&lt;BR /&gt;"measure_X", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "X"),&lt;BR /&gt;"measure_Y", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "Y")&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR T2 =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;T1,&lt;BR /&gt;"measure2",&lt;BR /&gt;IF(&lt;BR /&gt;[YearMonth] &amp;lt; curM,&lt;BR /&gt;[measure_X],&lt;BR /&gt;[measure_Y]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR T3 =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;T2,&lt;BR /&gt;"Delta", [measure1] - [measure2]&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR T4 =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;T3,&lt;BR /&gt;"RunningTotal",&lt;BR /&gt;VAR YM = [YearMonth]&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(T3, [YearMonth] &amp;lt;= YM),&lt;BR /&gt;[Delta]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;MAXX(&lt;BR /&gt;FILTER(T4, [YearMonth] = CurrentYM),&lt;BR /&gt;[RunningTotal]&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If this solution helped, please consider marking the response as accepted and giving it a thumbs-up so others can benefit as well.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Prasanna Kumar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 07:42:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4701120#M180075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-21T07:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4701205#M180077</link>
      <description>&lt;P&gt;it also returns deltas instead of running total&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 08:31:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4701205#M180077</guid>
      <dc:creator>BIuser09</dc:creator>
      <dc:date>2025-05-21T08:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4702565#M180112</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;Try this dax measure with virtual table&lt;/P&gt;
&lt;P&gt;Running Total Delta =&lt;BR /&gt;VAR CurrentYM = SELECTEDVALUE('Calendar'[YearMonth])&lt;/P&gt;
&lt;P&gt;VAR curM = VALUE(FORMAT(TODAY(), "YYYYMM"))&lt;BR /&gt;VAR prevM = VALUE(FORMAT(EDATE(TODAY(), -1), "YYYYMM"))&lt;/P&gt;
&lt;P&gt;VAR T1 =&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Calendar'[YearMonth], DATA),&lt;BR /&gt;'Calendar'[YearMonth] &amp;gt;= prevM&lt;BR /&gt;),&lt;BR /&gt;'Calendar'[YearMonth],&lt;BR /&gt;"measure1", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "1"),&lt;BR /&gt;"measure_X", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "X"),&lt;BR /&gt;"measure_Y", CALCULATE(SUM(DATA[Value]), DATA[Measure] = "Y")&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR T2 =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;T1,&lt;BR /&gt;"Delta",&lt;BR /&gt;VAR YM = [YearMonth]&lt;BR /&gt;VAR measure2 = &lt;BR /&gt;IF(&lt;BR /&gt;YM &amp;lt; curM,&lt;BR /&gt;[measure_X],&lt;BR /&gt;[measure_Y]&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;[measure1] - measure2&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR RunningTotal =&lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;T2,&lt;BR /&gt;[YearMonth] &amp;lt;= CurrentYM&lt;BR /&gt;),&lt;BR /&gt;[Delta]&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;RunningTotal&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If the issue persists, please share a sample PBIX file with representative data. This will help in accurately replicating and resolving the problem.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If this solution helped, please consider marking the response as accepted and giving it a thumbs-up so others can benefit as well.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Prasanna Kumar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 03:38:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4702565#M180112</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-22T03:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4707519#M180287</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.&lt;/P&gt;
&lt;P&gt;If the response addressed your query, kindly mark it as &lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt; and click &lt;STRONG&gt;Yes&lt;/STRONG&gt; if you found it helpful&amp;nbsp; this will benefit others in the community as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Prasanna Kumar&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 12:14:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4707519#M180287</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-26T12:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4707580#M180293</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for the responses but I did not get an answer on my question.&lt;/P&gt;&lt;P&gt;I do have a solution for my running total in a single measure.&lt;/P&gt;&lt;P&gt;But i wanted to make a measure on my virtual table as I originally requested (see above).&lt;/P&gt;&lt;P&gt;This virtual table is completely logical and easy to build. Correct answer is in the virtual table but cannot be used in a measure. which is a disappointment.&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 12:27:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4707580#M180293</guid>
      <dc:creator>BIuser09</dc:creator>
      <dc:date>2025-05-26T12:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4708428#M180333</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;The issue arises because DAX measures must return a single scalar value, while your virtual table correctly computes row-wise running totals that can’t be directly surfaced in a measure. Even though your virtual table logic is valid and produces accurate results, DAX cannot preserve row context across visual columns in a measure. As a result, expressions like MAXX or SUMX over the virtual table collapse the context and only return individual deltas instead of a cumulative result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this solution helped, please consider marking the response as accepted and giving it a thumbs-up so others can benefit as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Prasanna Kumar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2025 07:13:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4708428#M180333</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-27T07:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4713131#M180516</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.&lt;/P&gt;
&lt;P&gt;If the response addressed your query, kindly mark it as &lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt; and click &lt;STRONG&gt;Yes&lt;/STRONG&gt; if you found it helpful&amp;nbsp; this will benefit others in the community as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Prasanna Kumar&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 02:25:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4713131#M180516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-30T02:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4716045#M180635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694784" data-lia-user-login="BIuser09" class="lia-mention lia-mention-user"&gt;BIuser09&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just a gentle reminder&amp;nbsp; has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as &lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt;, or feel free to share your own if you found a different fix.&lt;/P&gt;
&lt;P&gt;This not only closes the loop on your query but also helps others in the community solve similar issues faster.&lt;/P&gt;
&lt;P&gt;Thank you for your time and feedback!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Prasanna Kumar&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 05:39:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4716045#M180635</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-02T05:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: using Virtual tables to get running total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4738648#M181499</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This week I found the solution, thanks to a colleague.&lt;BR /&gt;It is possible and I would like to share this with you.&lt;/P&gt;&lt;P&gt;Issue was the last line. You'll need to filter to 1 record in the virtual table. Use calendar dimension used in the matrix.&lt;/P&gt;&lt;P&gt;Note also that all filter fields (in FACT and Dimension tables) will have to be defined in the Calculate of VAR T1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TableRunningTotal = 
VAR curM = VALUE(CONCATENATE(YEAR(now()), FORMAT(MONTH(now()),"00")) )
VAR prevM = IF(MONTH(today())=1,
    VALUE(CONCATENATE(YEAR(today())-1, "12")),
    VALUE(CONCATENATE(YEAR(today()), FORMAT(MONTH(TODAY())-1,"00")))
)

VAR T1 = SUMMARIZE(
        FILTER(ALL(DATA),VALUE([Month]) &amp;gt;= prevM), 
        'Calendar'[YearMonth],
        "measure1", CALCULATE(sum(DATA[Value]), DATA[Measure] = "1"),
        "measure_X", CALCULATE(sum(DATA[Value]), DATA[Measure] = "X"),
        "measure_Y", CALCULATE(sum(DATA[Value]), DATA[Measure] = "Y"),
    )
VAR T2 = ADDCOLUMNS(T1, "measure2", if(VALUE([YearMonth]) &amp;lt; curM, [measure_X], [measure_Y]) )
VAR T3 = ADDCOLUMNS(T2, "Delta", [measure1]-[ measure2] )
VAR T4 = ADDCOLUMNS(T3,"RunningTotal", SUMX(FILTER(T3, [YearMonth]&amp;lt;=EARLIER([YearMonth])), [Delta]) )
RETURN
     MAXX(FILTER(T4,[YearMonth] = SELECTEDVALUE(Calendar[YearMonth])), [Cum_Delta])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2025 11:42:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-Virtual-tables-to-get-running-total/m-p/4738648#M181499</guid>
      <dc:creator>BIuser09</dc:creator>
      <dc:date>2025-06-20T11:42:17Z</dc:date>
    </item>
  </channel>
</rss>

