<?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: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/3249502#M119858</link>
    <description>&lt;P&gt;Hi Aniya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if there is a way to see what each of your variables calculates to? I'm trying to understand what each one accomplishes.&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2023 18:17:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-05-23T18:17:27Z</dc:date>
    <item>
      <title>Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2947270#M97560</link>
      <description>&lt;P&gt;Hello friends&lt;/P&gt;&lt;P&gt;I want to calculate the **Opening** **Balance** for the attached Trial Balance, the opening balance should be dynamic based on the selected date in the dates slicer.&lt;/P&gt;&lt;P&gt;Then the **Debit** and **Credit** is the Movement between the selected dates in the **dates slicer**&lt;BR /&gt;The Net Changes is simple = **Debit** - **Credit**&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Finally, the **Ending Balance** is the sum of all the transactions until the selected slicer **max date**&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance, I'm able to achieve the same in Power Query, but I like to create the same using DAX.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 05:29:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2947270#M97560</guid>
      <dc:creator>MahmoudElgendi</dc:creator>
      <dc:date>2022-12-05T05:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2947273#M97562</link>
      <description>&lt;P&gt;I tried to attach the file but I did not see the option to attach&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I uploaded here on GoogleDrive&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1zl0o9CohiAsL9CzXrL32qYNLaOV0Wr-B/view?usp=share_link" target="_blank"&gt;https://drive.google.com/file/d/1zl0o9CohiAsL9CzXrL32qYNLaOV0Wr-B/view?usp=share_link&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 05:31:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2947273#M97562</guid>
      <dc:creator>MahmoudElgendi</dc:creator>
      <dc:date>2022-12-05T05:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2947350#M97567</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="481642" data-lia-user-login="MahmoudElgendi" class="lia-mention lia-mention-user"&gt;MahmoudElgendi&lt;/a&gt; , we have inventory method &lt;/P&gt;
&lt;P&gt;Inventory / OnHand &lt;BR /&gt;[Intial Inventory] + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] &amp;lt;=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] &amp;lt;=maxx(date,date[date])))&lt;BR /&gt;&lt;BR /&gt;Inventory / OnHand &lt;BR /&gt;CALCULATE(firstnonblankvalue('Date'[Month]),sum(Table[Intial Inventory]),all('Date')) + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] &amp;lt;=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] &amp;lt;=maxx(date,date[date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI Inventory On Hand&lt;BR /&gt;Power BI Inventory On Hand: &lt;A href="https://youtu.be/nKbJ9Cpb-Aw" target="_blank"&gt;https://youtu.be/nKbJ9Cpb-Aw&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or you can use opening balanace&lt;/P&gt;
&lt;P&gt;Power Bi DAX Functions openingbalancemonth, openingbalancequarter, openingbalanceyear, firstnonblankvalue, and parallelperiod.Opening Stock, First value of period: &lt;A href="https://youtu.be/6lzYOXI5wfo" target="_blank"&gt;https://youtu.be/6lzYOXI5wfo&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BOP and EOP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Current Employees BOP = CALCULATE(COUNTx(FILTER(f_Employees,f_Employees[EmpJoinDate]&amp;lt; Min(d_DateTable[Date]) &amp;amp;&amp;amp; &lt;BR /&gt;(ISBLANK(f_Employees[EmpLeavDate]) || f_Employees[EmpLeavDate]&amp;gt;=Min('d_DateTable'[Date]))),&lt;BR /&gt;(f_Employees[EmplCode])),CROSSFILTER(f_Employees[EmpJoinDate],'d_DateTable'[Date],None))&lt;/P&gt;
&lt;P&gt;Current Employees EOP = CALCULATE(COUNTx(FILTER(f_Employees,f_Employees[EmpJoinDate]&amp;lt;=max(d_DateTable[Date]) &amp;amp;&amp;amp; &lt;BR /&gt;(ISBLANK(f_Employees[EmpLeavDate]) || f_Employees[EmpLeavDate]&amp;gt;max('d_DateTable'[Date]))),&lt;BR /&gt;(f_Employees[EmplCode])),CROSSFILTER(f_Employees[EmpJoinDate],'d_DateTable'[Date],None))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 06:01:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2947350#M97567</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-12-05T06:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2949377#M97711</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm actually looking for a better solution&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 19:26:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2949377#M97711</guid>
      <dc:creator>MahmoudElgendi</dc:creator>
      <dc:date>2022-12-05T19:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2950229#M97775</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My main issue is the Opening Balance, It should calc. like that, the &lt;STRONG&gt;Cumulative Sum of the Amount&lt;/STRONG&gt; between the first &lt;STRONG&gt;date&lt;/STRONG&gt; in the &lt;STRONG&gt;transactions&lt;/STRONG&gt; until the &lt;STRONG&gt;Min Selected date&lt;/STRONG&gt; in the Slicer&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 05:38:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2950229#M97775</guid>
      <dc:creator>MahmoudElgendi</dc:creator>
      <dc:date>2022-12-06T05:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2950489#M97795</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="481642" data-lia-user-login="MahmoudElgendi" class="lia-mention lia-mention-user"&gt;MahmoudElgendi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I download your .pbix file and test in my side , do you mean you want to get the data from this No's minest date to the Min_selected_date. Right?&lt;/P&gt;
&lt;P&gt;You can try to use this dax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Opening Balance = 
 var _curno = MAX('ChartOfAccounts'[G/L Account No.])
 var _min_selected_date = [Min Selected Date]
 var _trans_date = MINX( FILTER( ALL('GL_Entries') , 'GL_Entries'[GLAccountNo] = _curno) , [Date])
 var _t = FILTER( ALL('GL_Entries') , 'GL_Entries'[GLAccountNo]=_curno &amp;amp;&amp;amp; 'GL_Entries'[Date]&amp;lt; _min_selected_date &amp;amp;&amp;amp; 'GL_Entries'[Date]&amp;gt;= _trans_date)
 return
SUMX(_t,[Amount])&lt;/LI-CODE&gt;
&lt;P&gt;The result is as follows:&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;
&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;</description>
      <pubDate>Tue, 06 Dec 2022 07:05:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2950489#M97795</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-12-06T07:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2952229#M97941</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433015" data-lia-user-login="v-yueyunzh-msft" class="lia-mention lia-mention-user"&gt;v-yueyunzh-msft&lt;/a&gt;&amp;nbsp;&amp;nbsp;Thanks so much for your support&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 18:43:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/2952229#M97941</guid>
      <dc:creator>MahmoudElgendi</dc:creator>
      <dc:date>2022-12-06T18:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/3249502#M119858</link>
      <description>&lt;P&gt;Hi Aniya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if there is a way to see what each of your variables calculates to? I'm trying to understand what each one accomplishes.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 18:17:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/3249502#M119858</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-23T18:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Trial Balance with Opening, Debit, Credit, Net Change and Ending Balance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/3549746#M136540</link>
      <description>&lt;P&gt;Dear friends, Your solution works very well. But the Total balance is keep getting wrong. What would be possible reason. It is only taking one accoutns balances,&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 21:33:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Trial-Balance-with-Opening-Debit-Credit-Net-Change-and/m-p/3549746#M136540</guid>
      <dc:creator>AkshayGatkal</dc:creator>
      <dc:date>2023-11-23T21:33:04Z</dc:date>
    </item>
  </channel>
</rss>

