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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello Everyone,
I have 3 tables, i have to calculate overdues days
Customer Ledger Entry table
| Customer Code | Invoice Date | Invoice No | Due Date |
| TRD00755 | 04/01/2015 | IN000001 | 04/01/2015 |
| TRD00755 | 04/01/2015 | CR000001 | 04/01/2015 |
| TRD00791 | 04/01/2015 | IN000002 | 04/01/2015 |
| TRD00791 | 04/01/2015 | CR000002 | 04/01/2015 |
| TRD01349 | 04/01/2015 | IN000003 | 04/01/2015 |
| TRD00564 | 04/01/2015 | IN000004 | 04/01/2015 |
| TRD00690 | 04/01/2015 | IN000005 | 04/01/2015 |
| TRD00690 | 04/01/2015 | CR000003 | 04/01/2015 |
| TRD01379 | 04/01/2015 | IN000006 | 04/04/2015 |
| TRD01379 | 04/01/2015 | CR000004 | 04/01/2015 |
| TRD01167 | 04/01/2015 | IN000007 | 04/01/2015 |
| TRD00942 | 04/01/2015 | IN000008 | 04/01/2015 |
| TRD00942 | 04/01/2015 | CR000005 | 04/01/2015 |
Detailed Cust Ledger Entry
| Posting Date | Invoice No | Amount | Customer Code |
| 01/01/1753 | 0 | ||
| 04/01/2015 | IN000001 | 498.5 | TRD00755 |
| 04/01/2015 | CR000001 | -80.5 | TRD00755 |
| 04/01/2015 | CR000001 | -80.5 | TRD00755 |
| 04/01/2015 | CR000001 | 80.5 | TRD00755 |
| 04/01/2015 | IN000002 | 2313.46 | TRD00791 |
Customer table
| Customer Code | Customer Name |
| TRD00250 | Indian Association Umm Al Quwain (IAU) |
| TRD00251 | Pharmatrade(Abu Dhabi) |
| TRD00252 | United Medical Supplies (UNIMED)L.L.C |
| TRD00253 | Ambassador Pharmacy |
| TRD00261 | Al Ahliya Pharmacy |
Expected Result Format
How do i calculate overdues days..
Kindly Help
Hi @Anonymous ,
You need to create a date table and then make the following:
Overdue Days =
IF (
SUM ( 'Detailed Cust Ledger Entry'[Amount] ) = BLANK ();
BLANK ();
DATEDIFF ( SELECTEDVALUE ( 'Customer Ledger Entry'[Due Date] ); TODAY (); DAY )
)
Check PBIX file attach, please be aware that this file has a relationship between the invoice date an the dimdate so the slicer works looking for the invoice date if you want to slice accordingly to the due date you need to make the relationship with Due date column.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCheck out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!