Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have below sample dataset where I am looking for compute outstaning balances.
Invoice is issued against certain services with due date to pay, and cash receipt is issued when we receive the cash against respective invoice(s). It does not has to be per invoice calculation, but overall outstanding balance is fine. There could be instances when we receive the full or partial/no payments.
| trans_date | Trans_type | Invoice # | Due Date | Amount |
| 4/24/2023 | Invoice | 101 | 5/24/2023 | 100 |
| 4/24/2023 | Invoice | 202 | 5/24/2023 | 200 |
| 4/24/2023 | Invoice | 301 | 5/24/2023 | 300 |
| 4/24/2023 | Invoice | 401 | 5/24/2023 | 400 |
| 4/24/2023 | Invoice | 501 | 5/24/2023 | 500 |
| 6/13/2023 | Cash Receipt | 101 | 7/13/2023 | -100 |
| 6/13/2023 | Cash Receipt | 202 | 7/13/2023 | -200 |
| 6/13/2023 | Cash Receipt | 301 | 7/13/2023 | -300 |
| 6/13/2023 | Cash Receipt | 401 | 7/13/2023 | -400 |
| 6/13/2023 | Cash Receipt | 501 | 7/13/2023 | -400 |
Need help how to achieve this.
Hi @snaseem
You can refer to the following calculated column
Differ =
VAR sum_invoice =
SUMX ( FILTER ( 'Table', [Trans_type] = "Invoice" ), [Amount] )
VAR sum_cash =
SUMX ( FILTER ( 'Table', [Trans_type] = "Cash Receipt" ), [Amount] )
RETURN
sum_invoice + sum_cash
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can yo just create a matrix table and drag and drop the Invoice # to Rows, Trans Type to Columns and Amount to Values. The total will give you the outstanding balance
Can we do this with the help of dax? I may need to add some other analysis as well such as avg time to pay the invoice etc.
yes, but if you want to actually type the dax formulas it be something like this
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 35 | |
| 34 | |
| 27 |
| User | Count |
|---|---|
| 134 | |
| 101 | |
| 71 | |
| 67 | |
| 65 |