cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jeronimo2334 Frequent Visitor
Frequent Visitor

Calculate Balance based on Date

Hi all,

 

So I have 3 tables, one with customers, one with customers' charges and one with customers' payments. I am trying to figure out a good way to get a balance for each customer. The user wants to select a date from a date picker and the table should return what the total balance up to that day was.

 

Any recommendations are welcome.

 

 

customerIdName
1alpha
2beta
3gamma
4delta
5phi

 

 

customerIddatecharge
19/23/20185
29/23/201812
19/25/201813
39/25/201814
39/25/201841
59/27/201822
59/27/201817

 

 

customerIddatepayment
19/12/201835
29/12/201823
19/16/201813
39/18/201814
39/25/201841
59/23/20182
59/23/201817
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Calculate Balance based on Date

@jeronimo2334 hope attached will get you going






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

2 REPLIES 2
MisterFry Frequent Visitor
Frequent Visitor

Re: Calculate Balance based on Date

You could create a disconnected date slicer that allows the user to select a date, detect that date via SELECTEDVALUE(), and use Balance = CALCULATE(SUM(CREDITS), date <= SELECTEDVALUE([DisconectedDateField])) - CALCULATE(SUM(DEBITS), date <= SELECTEDVALUE([DisconectedDateField])) 

 

You could generate the list of dates by either doing a SUMMARIZE() on a concatenation of your other table's date fields, or you could autogenerate them in power query using List.Generate()

Super User
Super User

Re: Calculate Balance based on Date

@jeronimo2334 hope attached will get you going






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 424 members 4,031 guests
Please welcome our newest community members: