Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Calculating overdue days

Hello Everyone,

 

I have 3 tables, i have to calculate overdues days

 

Customer Ledger Entry table

 

 

Customer CodeInvoice DateInvoice NoDue Date
TRD0075504/01/2015IN00000104/01/2015
TRD0075504/01/2015CR00000104/01/2015
TRD0079104/01/2015IN00000204/01/2015
TRD0079104/01/2015CR00000204/01/2015
TRD0134904/01/2015IN00000304/01/2015
TRD0056404/01/2015IN00000404/01/2015
TRD0069004/01/2015IN00000504/01/2015
TRD0069004/01/2015CR00000304/01/2015
TRD0137904/01/2015IN00000604/04/2015
TRD0137904/01/2015CR00000404/01/2015
TRD0116704/01/2015IN00000704/01/2015
TRD0094204/01/2015IN00000804/01/2015
TRD0094204/01/2015CR00000504/01/2015

 

Detailed Cust Ledger Entry

 

 

Posting DateInvoice NoAmountCustomer Code
01/01/1753 0 
04/01/2015IN000001498.5TRD00755
04/01/2015CR000001-80.5TRD00755
04/01/2015CR000001-80.5TRD00755
04/01/2015CR00000180.5TRD00755
04/01/2015IN0000022313.46TRD00791

 

Customer table

 

 

Customer CodeCustomer Name
TRD00250Indian Association Umm Al Quwain (IAU)
TRD00251Pharmatrade(Abu Dhabi)
TRD00252United Medical Supplies (UNIMED)L.L.C
TRD00253Ambassador Pharmacy
TRD00261Al Ahliya Pharmacy

 

Expected Result Format

 

Expected Result.JPG

 

How do i calculate overdues days..

 

Kindly Help

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to create a date table and then make the following:

  • Relationships:
    • DimDate -> CustomerLedgerEntry
    • Customer -> Customer Ledger Entry
    • CustomerLedger Entry -> Detailed Cust Ledger
  • Date slicer (based on dimDate table)
  • Customer slicer based on customer table)
  • Now create the following measure:
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


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors