<?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: Calculate opening balance together with transaction based data into one visual in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214380#M19591</link>
    <description>&lt;P&gt;This works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;cumul = 
var m=max('Table (2)'[Month])
var c = CALCULATE(sum('Table (2)'[Value]),ALLSELECTED('Table'),'Table (2)'[Month]&amp;lt;=m)
return if (HASONEVALUE('Table (2)'[Group])
,sum('Table (2)'[Value])
,c)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want you can add the initial opening balance to c. Obviously that has to come from an outside data source.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the sample data. First table is regular, second uses the cumulative measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 10:27:36 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2020-07-10T10:27:36Z</dc:date>
    <item>
      <title>Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1210151#M19468</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I hope you can help me out&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to show both open and closing balances based on a lot of transactions from one dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to show opening balance up top and closing balance in the buttom of my matrix visual and in between is the kind of transaction which have adjusted the opening balance for the selected month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data comes in the following diminsions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date, amount, Transaction group.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problems is, how do i get the opening balance to show closing balance of last month for this month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently it is look like this:&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;(Sorry for the red markings but the groups a confidencial)&lt;/P&gt;&lt;P&gt;But i need it to go like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have gotten the first opening balance by creating a transaction group called opening balance and manuelle putting into my dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not a year to date visual. I have to see the impact each transaction group have on the "current" opening balance pr. month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking forward to hear from you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 05:58:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1210151#M19468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-09T05:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1213143#M19566</link>
      <description>&lt;P&gt;are 1,2,3,4 month numbers that are tied into your dates table?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 22:58:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1213143#M19566</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-09T22:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1213627#M19576</link>
      <description>&lt;P&gt;Yes that is correct&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 05:41:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1213627#M19576</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T05:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214292#M19587</link>
      <description>&lt;P&gt;- You don't need to worry about the closing balance, that's basically the total for the row (you can rename the "Total"&amp;nbsp; label)&lt;/P&gt;&lt;P&gt;- You need a measure for the opening balance for each month - simple to implement&lt;/P&gt;&lt;P&gt;- BUT if you want your table to look like that you will also need to create measures for every group.&amp;nbsp; Are you sure you want that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One alternative would be to use two table visuals, one just for the opening balance and another for the actual data. You can make them look like they are one table.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 09:51:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214292#M19587</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-10T09:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214308#M19588</link>
      <description>&lt;P&gt;I dont want to create a measure for every group as it will confuse the user when drilling down for each category. (i assume you would create a measure for each transaction type and format the values to be on rows instead of columns)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I like the your alternative, but how is the closing balance calulated as it does not have the opening balance´? (a third table below the actual data table)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 09:58:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214308#M19588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T09:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214316#M19589</link>
      <description>&lt;P&gt;There's no need for that if your total portion of the measure in the second table is cumulative. Actually in both tables, just shifted by a month.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 10:02:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214316#M19589</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-10T10:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214331#M19590</link>
      <description>&lt;P&gt;Would it be possible to show a eksamble, i dont quite get how you will calculate the closing balance without a opening balance (will you create a measure for each cateogry in this eksamble?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 10:04:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214331#M19590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T10:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214380#M19591</link>
      <description>&lt;P&gt;This works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;cumul = 
var m=max('Table (2)'[Month])
var c = CALCULATE(sum('Table (2)'[Value]),ALLSELECTED('Table'),'Table (2)'[Month]&amp;lt;=m)
return if (HASONEVALUE('Table (2)'[Group])
,sum('Table (2)'[Value])
,c)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want you can add the initial opening balance to c. Obviously that has to come from an outside data source.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the sample data. First table is regular, second uses the cumulative measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 10:27:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1214380#M19591</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-10T10:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate opening balance together with transaction based data into one visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1234933#M20194</link>
      <description>&lt;P&gt;So i have finally found a suitable solution where my opening balance is the first value of my each month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is did was to dublicate my query, group all my rows into months. This will act as my opening balance for the following month. Then i "pushed" the date 1 month so it would look like my grouped values belonged to current month + 1. I then added this query to my original query and gave them "opening balance" as transaction group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now my data set has a opening balance value as part of the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my visual looks like this with a simple sum formual:&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, 20 Jul 2020 11:51:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-opening-balance-together-with-transaction-based-data/m-p/1234933#M20194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-20T11:51:35Z</dc:date>
    </item>
  </channel>
</rss>

