<?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: end / start balance based of mesures in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2996948#M101032</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="473427" data-lia-user-login="ReutAtias12" class="lia-mention lia-mention-user"&gt;ReutAtias12&lt;/a&gt; , to me it seems like a case of cumulative measure &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;beginning&lt;/P&gt;
&lt;P&gt;calculate( [New Business] + [UP - Sell] + [ Churn], filter(all(Date), Date[Date]&amp;lt; Min(Date[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;End&lt;/P&gt;
&lt;P&gt;calculate( [New Business] + [UP - Sell] + [ Churn], filter(all(Date), Date[Date]&amp;lt;= max(Date[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jan 2023 14:45:02 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2023-01-02T14:45:02Z</dc:date>
    <item>
      <title>end / start balance based of mesures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2996915#M101029</link>
      <description>&lt;P&gt;I created a matrix in which each row is based on mesure&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD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P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the start balance is supposed to be the end balance from the last quarter&lt;/P&gt;&lt;P&gt;and the end balance is supposed to be the total of all the measures in the same quarter&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Start Balance = 
IF(CALCULATE([Total Targets], PREVIOUSQUARTER(dimDates[Date])) = 0 , 
0,
 CALCULATE([End Balance], PREVIOUSQUARTER(dimDates[Date])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;End Balance = 
var _cyc = [New Business] + [UP - Sell] + [ Churn]
var _cycLQ = CALCULATE([New Business] + [UP - Sell] + [ Churn],PREVIOUSQUARTER(dimDates[Date]))
return 
IF(CALCULATE([Total Targets],PREVIOUSQUARTER(dimDates[Date])) = 0,
_cyc,
[Start Balance] +_cyc)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the end balance is not working (I can't use the [start balance] in the [end balance])&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I fix that?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 14:25:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2996915#M101029</guid>
      <dc:creator>ReutAtias12</dc:creator>
      <dc:date>2023-01-02T14:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: end / start balance based of mesures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2996948#M101032</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="473427" data-lia-user-login="ReutAtias12" class="lia-mention lia-mention-user"&gt;ReutAtias12&lt;/a&gt; , to me it seems like a case of cumulative measure &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;beginning&lt;/P&gt;
&lt;P&gt;calculate( [New Business] + [UP - Sell] + [ Churn], filter(all(Date), Date[Date]&amp;lt; Min(Date[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;End&lt;/P&gt;
&lt;P&gt;calculate( [New Business] + [UP - Sell] + [ Churn], filter(all(Date), Date[Date]&amp;lt;= max(Date[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 14:45:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2996948#M101032</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-02T14:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: end / start balance based of mesures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2996976#M101035</link>
      <description>&lt;P&gt;can my start point for the&amp;nbsp;&lt;SPAN&gt;cumulative&amp;nbsp;calculation be only after [total targets] on the PREVIOUS QUARTER&amp;nbsp;= 0&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE([Total Targets], PREVIOUSQUARTER(dimDates[Date])) = 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 15:04:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2996976#M101035</guid>
      <dc:creator>ReutAtias12</dc:creator>
      <dc:date>2023-01-02T15:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: end / start balance based of mesures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2997553#M101071</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="473427" data-lia-user-login="ReutAtias12" class="lia-mention lia-mention-user"&gt;ReutAtias12&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to calculate the sum of the measures in row headers?&lt;/P&gt;
&lt;P&gt;If this , you can refer to this:&lt;BR /&gt;(1)This is my test data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)I create two measures to test:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(3)Then we need to create&amp;nbsp; a dimension table to put on the Matrix visual:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(4)Then we need to create a measure like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Value = var _row = MAX('Row'[Column1])
return
SWITCH(_row,
"Start Balance" , [Start Balance] , 
"Test Sum" , [Test Sum],
"Total" , [Start Balance]+ [Test Sum]
)&lt;/LI-CODE&gt;
&lt;P&gt;(5)Then we can pot the fields we need on the Matix visual and we can meet your need:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 03:32:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/end-start-balance-based-of-mesures/m-p/2997553#M101071</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2023-01-03T03:32:30Z</dc:date>
    </item>
  </channel>
</rss>

