This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
SO I have two tables Bills and Payments, Each customer has One bill and they pay it off in stages over the Year, I am trying to get to the amount Unpaid BUT not count any bills which may have been over paid.
CustomerBills
| Customer ID | Bill Amount |
| 1 | 100 |
| 2 | 150 |
| 3 | 120 |
| 4 | 110 |
| 5 | 200 |
CustomersPayment
| Customer ID | Paid Amount |
| 1 | 50 |
| 1 | 50 |
| 2 | 50 |
| 2 | 50 |
| 3 | 120 |
| 4 | 50 |
| 4 | 50 |
| 4 | 10 |
| 5 | 50 |
| 5 | 50 |
| 5 | 50 |
| 5 | 75 |
I need to get to 50 Overdue and not the total sum which shows as 25 (Customer 5 is over paid)
Thanks in advance
Simon
Solved! Go to Solution.
Hey @tsql_simon ,
not sure if I understand your requirement 100%.
I created the following 2 measures, this is more a habit than necessary for the solution:
Total Bill Amount = SUM('CustomersBill'[Bill Amount])
and
Total Paid Amount = SUM('CustomersPayment'[Paid Amount])
After this I created the following measure that now provides the solution (at least from my understanding of your requirement):
Overdue Amount =
SUMX(
VALUES(CustomersBill[Customer ID])
, var billed = [Total Bill Amount]
var paid = [Total Paid Amount]
var diff = billed - paid
return
IF(diff > 0 , diff , BLANK())
)
This allows to a create a report like this:
Hopefully this provides what you are looking for.
Regards,
Tom
Hey @tsql_simon ,
not sure if I understand your requirement 100%.
I created the following 2 measures, this is more a habit than necessary for the solution:
Total Bill Amount = SUM('CustomersBill'[Bill Amount])
and
Total Paid Amount = SUM('CustomersPayment'[Paid Amount])
After this I created the following measure that now provides the solution (at least from my understanding of your requirement):
Overdue Amount =
SUMX(
VALUES(CustomersBill[Customer ID])
, var billed = [Total Bill Amount]
var paid = [Total Paid Amount]
var diff = billed - paid
return
IF(diff > 0 , diff , BLANK())
)
This allows to a create a report like this:
Hopefully this provides what you are looking for.
Regards,
Tom
Hi @TomMartens ;
You understood perfectly, Thank you very much, I have been fighting with similar SUMX logic but could not piece it together quite right. That works perfectly for me.
Kindest Regards
Simon
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 36 | |
| 30 | |
| 23 | |
| 22 |