<?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: Daily Balance Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121923#M110751</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you creating? A calculated column or a measure?&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2023 15:26:41 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-03-09T15:26:41Z</dc:date>
    <item>
      <title>Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121361#M110693</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to get the daily closing balance of my data. I currently have dates given by 'Date'[Date] showing the working days (weekends are blank) of debits and credits being logged.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;At the moment, I only have one value for the closing balance each month, which is the 'GL_Period'[FinancialPeriod] date, but I have the daily net debit/credit balance within a measure called [Daily Net Balance] to use to calculate the daily closing balance (see below). The closing balance is given in 'GL_Account'[ClosingBalance].&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So what I need is for the Daily Closing Balance to be the previous financial period's closing balance and to have added all daily net balances up to the date being looked at.&lt;BR /&gt;E.g. For 02/03/2023: Closing Balance =&amp;nbsp;&lt;SPAN&gt;12,248,807.97 &lt;/SPAN&gt;&lt;SPAN&gt;- 5,990.75 - 222,586.15 + 26,775.00&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please see the below Excel for what the ideal results would be like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 11:41:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121361#M110693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-09T11:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121441#M110706</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;You are sorting the dates on descending order. Are you sure this is the correct order of calculation?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 12:35:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121441#M110706</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T12:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121473#M110708</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yes I already had in the model a variable for debits/credits linked to the Date, so my Daily Net Balance was just:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;Daily Net Balance = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'GL_Account'&lt;/SPAN&gt;&lt;SPAN&gt;[glt_amt_doc]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;GROUPBY&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[date]&lt;/SPAN&gt;&lt;SPAN&gt;)).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;In terms of the closing balance, this is correct also. It is the closing balance whereby it stops at the FinancialPeriod date, i.e. 12,177,354.57 is the closing balance today and whatever the closing balance is on 31st March, the closing balance will show as this value for all dates 25th February 2023 - 31st March 2023. Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Mar 2023 12:49:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121473#M110708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-09T12:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121557#M110717</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should work as either calculated column or measure.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Closing Balance Final =
VAR CurrentDate =
    MAX ( 'Table'[Date] )
VAR CurrentPeriodTable =
    CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[FinancialPeriod] ) )
VAR CurrentClosingBalance =
    MINX ( CurrentPeriodTable, 'Table'[ClosingBalance] )
VAR TableOnAndBefore =
    FILTER ( CurrentPeriodTable, 'Table'[Date] &amp;lt;= CurrentDate )
VAR PreviousDailyNetBalance =
    SUMX ( TableOnAndBefore, 'Table'[DailyNetBalance] )
RETURN
    CurrentClosingBalance + PreviousDailyNetBalance
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Mar 2023 13:22:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121557#M110717</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T13:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121850#M110745</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thanks for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I adjusted the DAX to the following (as it was not picking up the 'GL_Account'[ClosingBalance] and 'Date'[Date] in TableOnAndBefore):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DailyClosingBalance = 
VAR CurrentDate =
    MAX ( 'Date'[Date] )
VAR CurrentPeriodTable =
    CALCULATETABLE ( 'GL_Period', ALLEXCEPT ( 'GL_Period', 'GL_Period'[FinancialPeriod]))
VAR CurrentClosingBalance =
    MINX ( CurrentPeriodTable, SELECTEDVALUE('GL_Account'[ClosingBalance]) )
VAR TableOnAndBefore =
    FILTER ( CurrentPeriodTable, SELECTEDVALUE('Date'[Date]) &amp;lt;= CurrentDate )
VAR PreviousDailyNetBalance =
    SUMX ( TableOnAndBefore, [Daily Net Balance] )
RETURN
    CurrentClosingBalance + PreviousDailyNetBalance&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However this is now returning the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It is doing the row's ClosingBalance + Daily Net Balance, but it needs to be the previous financial periods closing balance + the sum of the daily net balances up to the rows date, e.g. 01/03/2023: 12,248,807.97 - 5,990.75 - 222,586.15 =&amp;nbsp;12,020,231.07&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:06:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121850#M110745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-09T15:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121923#M110751</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you creating? A calculated column or a measure?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:26:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121923#M110751</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T15:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121943#M110754</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One more thing &amp;nbsp;do you really think that it's not worth mentioning that the data os coming from two different tables? Do you really think that relationship are irrelevant and they do not matter? Please provide me with the complete picture to avoid wasting more time and effort.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:31:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121943#M110754</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T15:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121993#M110758</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to be as helpful as possible with my limited knowledge of DAX. I am new to this, which is why I am asking the forum. Also, I have the tables referenced in the original post.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;'Date'[Date] -&amp;gt; 'GL_Account'[glt_trdate], which is the transaction date.&lt;/P&gt;&lt;P&gt;'Company'[kco] -&amp;gt;&amp;nbsp;'GL_Account'[kco], which is 2 companies codes, 22 and 30, referencing the 2 companies in the dataset.&lt;/P&gt;&lt;P&gt;'GL_BusinessUnit'[id_glelement] -&amp;gt; 'GL_Account'[id_glelement], which have bank codes for the different divisions of the 2 companies.&lt;/P&gt;&lt;P&gt;'GL_Period'[id_glperiod] -&amp;gt; 'GL_Account'[id_glperiod], the FinancialPeriod in yyyy-mm-dd format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would be a calculated column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But please, I am trying to be helpful. If I am not being clear, just ask away as I do not know what is required. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:59:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3121993#M110758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-09T15:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3122088#M110764</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;is&amp;nbsp;[Daily Net Balance] a column or a measure? If measure please advise the dax&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 16:38:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3122088#M110764</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T16:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3122093#M110765</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;This should be a calculated column&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;DailyClosingBalance =
VAR CurrentDate = 'GL_Account'[glt_trdate]
VAR CurrentPeriod = 'GL_Account'[id_glperiod]
VAR TableOnAndBefore =
    FILTER ( 'GL_Period', 'GL_Period'[glt_trdate] &amp;lt;= CurrentDate )
VAR CurrentPeriodTable =
    FILTER ( TableOnAndBefore, 'GL_Account'[id_glperiod] = CurrentPeriod )
VAR PreviousDailyNetBalance =
    SUMX ( CurrentPeriodTable, 'GL_Account'[Daily Net Balance] )
VAR PreviousPeriodTable =
    TOPN (
        1,
        FILTER ( TableOnAndBefore, 'GL_Account'[id_glperiod] &amp;lt; CurrentPeriod ),
        'GL_Account'[id_glperiod]
    )
VAR PreviousClosingBalance =
    MAXX ( PreviousPeriodTable, 'GL_Account'[ClosingBalance] )
RETURN
    PreviousClosingBalance + PreviousDailyNetBalance&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Mar 2023 16:41:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3122093#M110765</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T16:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3122112#M110766</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help on this. My sincere apologies, but I did not know that you cannot create calculated columns from a live connection. Would it be possible to adjust this as a measure. Sorry again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 16:53:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3122112#M110766</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-09T16:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3122124#M110768</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;No worries.&amp;nbsp;&lt;BR /&gt;I'll get back to you tomorrow morning. Meanwhile it would be great if you have a sample file. Have a good night&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 17:02:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3122124#M110768</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T17:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3123085#M110851</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try the following. Probably won't work and sure not optimum but there is a chance that it would. If not, please let me know if we can connect on Saturday (any time before 2:00pm&amp;nbsp;Dubai time)&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;DailyClosingBalance =
VAR CurrentDate =
    SELECTEDVALUE ( 'GL_Account'[glt_trdate] )
VAR CurrentPeriod =
    SELECTEDVALUE ( 'GL_Period'[id_glperiod] )
VAR PreviousPeriod =
    MAXX (
        FILTER (
            ALLSELECTED ( 'GL_Period'[id_glperiod] ),
            'GL_Period'[id_glperiod] &amp;lt; CurrentPeriod
        ),
        'GL_Period'[id_glperiod]
    )
VAR PreviousClosingBalance =
    CALCULATE (
        MAX ( 'GL_Account'[ClosingBalance] ),
        'GL_Period'[id_glperiod] = PreviousPeriod,
        ALL ( 'Date' )
    )
VAR CurrentPeriodTable =
    CALCULATETABLE ( 'GL_Period', ALL ( 'Date' ) )
VAR TableOnAndBefore =
    FILTER ( CurrentPeriodTable, 'GL_Period'[glt_trdate] &amp;lt;= CurrentDate )
VAR PreviousDailyNetBalance =
    SUMX ( CurrentPeriodTable, 'GL_Account'[Daily Net Balance] )
RETURN
    PreviousClosingBalance + PreviousDailyNetBalance&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Mar 2023 05:03:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3123085#M110851</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-10T05:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3124182#M110917</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help, it's really appreciated. I added SELECTEDVALUE to the 'GL_Period'[glt_trdate] in the TableOnAndBefore variable but it has returned the same values as that in the Daily Net Balance measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I cannot share much more information, i.e. have a call with you/sample file as the overwhelming majority of the dataset contains confidental information, but is there anything I can do to help with reworking the DAX to help you in any way? Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 13:46:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3124182#M110917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-10T13:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3124323#M110925</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;no worries I understand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What results did you get without using SELECTEDVALUE? What is the reason for adding SELECTEDVALUE?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 14:43:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3124323#M110925</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-10T14:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3124557#M110935</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX says&amp;nbsp;"Cannot find name [glt_trdate]" with the following message when the measure is added to the table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 16:07:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3124557#M110935</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-10T16:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3124862#M110956</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh! My mistake. Please try&lt;/P&gt;
&lt;P&gt;DailyClosingBalance =&lt;BR /&gt;VAR CurrentDate =&lt;BR /&gt;SELECTEDVALUE ( 'GL_Account'[glt_trdate] )&lt;BR /&gt;VAR CurrentPeriod =&lt;BR /&gt;SELECTEDVALUE ( 'GL_Period'[id_glperiod] )&lt;BR /&gt;VAR PreviousPeriod =&lt;BR /&gt;MAXX (&lt;BR /&gt;FILTER (&lt;BR /&gt;ALLSELECTED ( 'GL_Period'[id_glperiod] ),&lt;BR /&gt;'GL_Period'[id_glperiod] &amp;lt; CurrentPeriod&lt;BR /&gt;),&lt;BR /&gt;'GL_Period'[id_glperiod]&lt;BR /&gt;)&lt;BR /&gt;VAR PreviousClosingBalance =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( 'GL_Account'[ClosingBalance] ),&lt;BR /&gt;'GL_Period'[id_glperiod] = PreviousPeriod,&lt;BR /&gt;ALL ( 'Date' )&lt;BR /&gt;)&lt;BR /&gt;VAR CurrentPeriodTable =&lt;BR /&gt;CALCULATETABLE ( 'GL_Account', ALL ( 'Date' ) )&lt;BR /&gt;VAR TableOnAndBefore =&lt;BR /&gt;FILTER ( CurrentPeriodTable, 'GL_Account'[glt_trdate] &amp;lt;= CurrentDate )&lt;BR /&gt;VAR PreviousDailyNetBalance =&lt;BR /&gt;SUMX ( CurrentPeriodTable, 'GL_Account'[Daily Net Balance] )&lt;BR /&gt;RETURN&lt;BR /&gt;PreviousClosingBalance + PreviousDailyNetBalance&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 18:22:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3124862#M110956</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-10T18:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3127409#M111135</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your continued help on this. It is now returning the sum of the daily net balances that are within the financial period.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 09:17:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3127409#M111135</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-13T09:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3127576#M111148</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After swapping the 'Date'[Date] out of the table for the transaction date, 'GL_Account'[glt_trdate], I actually have the Daily Net Balance returning as the DailyClosingBalance:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 10:12:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3127576#M111148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-13T10:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Balance Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3143728#M112365</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please update the formula of measure as below and check if it can return the expected result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DailyClosingBalance =
VAR CurrentDate =
    SELECTEDVALUE ( 'GL_Account'[glt_trdate] )
VAR CurrentPeriod =
    SELECTEDVALUE ( 'GL_Period'[id_glperiod] )
VAR PreviousPeriod =
    MAXX (
        FILTER (
            ALLSELECTED ( 'GL_Period'[id_glperiod] ),
            'GL_Period'[id_glperiod] &amp;lt; CurrentPeriod
        ),
        'GL_Period'[id_glperiod]
    )
VAR PreviousClosingBalance =
    CALCULATE (
        MAX ( 'GL_Account'[ClosingBalance] ),
        FILTER (
            ALLSELECTED ( 'GL_Period' ),
            'GL_Period'[id_glperiod] = PreviousPeriod
        ),
        ALL ( 'Date' )
    )
VAR PreviousDailyNetBalance =
    SUMX (
        FILTER ( ALLSELECTED ( 'GL_Account' ), 'GL_Account'[glt_trdate] &amp;lt;= CurrentDate ),
        'GL_Account'[Daily Net Balance]
    )
RETURN
    PreviousClosingBalance + PreviousDailyNetBalance&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;If the above one can't help you, please provide some&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in your table&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;'GL_Account'&lt;/STRONG&gt; and &lt;STRONG&gt;'GL_Period'&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;) with&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;format&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and your&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;with backend logic and special examples? By the way, is there any relationship between these two tables? If yes, please provide the related info. It would be helpful to find out the solution. You can refer the following links to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7UEf71Mu2ySWC7MlgciaPViM1RqU5nx4OHGHG5EvNSw%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 02:38:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-Balance-Calculation/m-p/3143728#M112365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-21T02:38:07Z</dc:date>
    </item>
  </channel>
</rss>

