cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lcasey
Post Partisan
Post Partisan

Use a calendar table for Invoices and Payments

Hello,

 

I cant beleive I have not found a solution on the web for this extreemly common request. I am hoping someone in here may have a solution.

 

I have 3 tables.  A calendar table an Invoice table and a Payment table.  Very simply, I am trying to calculate correct balances of customer records when choosing a specific date.

 

So when I select a date in the calendar table, it correctly filters the Invoice table to only show invoices as of the date selected, but the related table Payments all payments are showing even if the payment date is AFTER the chosen date in the date slicer.

 

Is there any way that Power BI can allow the selection of a date licer and then filter out not only the Invoice table , but also the paymjents table using that date ?

 

The 01.jpg

4 REPLIES 4
lcasey
Post Partisan
Post Partisan

I think I found a measure that may work: 

 

Balance Due = CALCULATE (
   [Balance],
    FILTER (
        ALL ( '00-Bad Debt - Payments'[DATE1]), MAX ( '00-Bad Debt - Invoices'[DOCDATE] )
    )
)

 

 

 

****Note*****

 

The "Balance"  Measure used in the calculate  is a simple formula of the difference between all invoices and all payments.

 

Balance = SUM('00-Bad Debt - Invoices'[SLSAMNT]) - Sum('00-Bad Debt - Payments'[APPTOAMT])

Hi @lcasey,

 

Could you try using the formula below to create a measure to see if it works in your scenario? Smiley Happy

Balance =
SUM ( '00-Bad Debt - Invoices'[SLSAMNT] )
    - CALCULATE (
        SUM ( '00-Bad Debt - Payments'[APPTOAMT] ),
        FILTER (
            ALL ( '00-Bad Debt - Payments' ),
            '00-Bad Debt - Payments'[DATE1] IN VALUES ( Calendar[Date] )
        )
    )

Regards

Hello,

 

Unfortunatly, that didnt work. The Balances are all wrong.    I used your formula in the BalanceTest measure.

 

 

 

01.jpg

That didnt work

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.