cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Running total based off column in second table

Hello,

I am trying to produce a running total based off of 2 tables. Example below:

GL Transactions Table 1.jpg

GL Description Table 2.jpg

 

They are connected by a relationship in the 'GL Account' columns on both tables. I am trying to produce a running total using the 'Date' (table 1) from the 'Amount' column in table 1 IF the GL account Description (on table 2) is UOO, AEU or AEP.

 

Any Ideas?

 

1 ACCEPTED SOLUTION
Microsoft
Microsoft

Hi @nmyre ,

 

Try this measure :

RunningTotal = 
var RunningTotal_all = CALCULATE(
SUM( Sheet6[amount] ),
FILTER(  ALL(Sheet6) ,
SUMX( FILTER( Sheet6, EARLIER( Sheet6[date] ) <= Sheet6[date]&&EARLIER(Sheet6[GL Account])=Sheet6[GL Account]), Sheet6[amount] )
)
)
return IF(MAX(Sheet7[GL Description code])in {"AEU","UOO","AEP"},RunningTotal_all)

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Microsoft
Microsoft

Hi @nmyre ,

 

Try this measure :

RunningTotal = 
var RunningTotal_all = CALCULATE(
SUM( Sheet6[amount] ),
FILTER(  ALL(Sheet6) ,
SUMX( FILTER( Sheet6, EARLIER( Sheet6[date] ) <= Sheet6[date]&&EARLIER(Sheet6[GL Account])=Sheet6[GL Account]), Sheet6[amount] )
)
)
return IF(MAX(Sheet7[GL Description code])in {"AEU","UOO","AEP"},RunningTotal_all)

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

To build a running total, you need a numeric column in your chart of accounts that can be used for ordering the running total. I suggest you look at my article and video here  https://exceleratorbi.com.au/build-a-pl-with-power-bi/

 

it covered everything needed to build a P&L



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors