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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
setis
Post Partisan
Post Partisan

Cumulative amount until EOM

Dear experts, 

 

I have a measure that calculates the overdue amount of all cases with a "Due date" on the selected month. 

 

It looks like this:

 

 

Overduev2.1 = 
CALCULATE(
SUMX(
    FILTER('ALL$Cust_ Ledger Entry', 'ALL$Cust_ Ledger Entry'[Due Date] <= TODAY()
    && (ISBLANK('ALL$Cust_ Ledger Entry'[Posting date DCLE])||
    'ALL$Cust_ Ledger Entry'[Posting date DCLE] > 'ALL$Cust_ Ledger Entry'[Due Date])), [OpenSales]))

 

 

The results are fine. 

 

There is an active relationship between ALL$Cust_ Ledger Entry'[Due Date] and my Date table  on 'Date[date]

 

What I'm trying to obtain is the cumulative overdue amount until the end of every month, so if there is an amount that is overdue in January and it's still overdue in February, the amount should show up in both months. 

 

My attempt is this but it's wrong:

 

Overduev2.2 = 
CALCULATE(
SUMX(
    FILTER('ALL$Cust_ Ledger Entry', 'ALL$Cust_ Ledger Entry'[Due Date] <= TODAY()
    && (ISBLANK('ALL$Cust_ Ledger Entry'[Posting date DCLE])||
    'ALL$Cust_ Ledger Entry'[Posting date DCLE] > 'ALL$Cust_ Ledger Entry'[Due Date])), [OpenSales]),
    FILTER(ALLSELECTED('Date'),
    'Date'[Date] <= 'Date'[Calendar EndOfMonth]))

 

 

The column 'Date'[Calendar EndOfMonth] is just a calculated column returning the last date of the month. 

 

xxxxx.PNG

 

Thank you in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@setis , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Date table should be joined with Due date and try like

 

Overduev2.2 =
CALCULATE(
SUMX(
FILTER('ALL$Cust_ Ledger Entry', (ISBLANK('ALL$Cust_ Ledger Entry'[Posting date DCLE])||
'ALL$Cust_ Ledger Entry'[Posting date DCLE] > 'ALL$Cust_ Ledger Entry'[Due Date])), [OpenSales]),
FILTER(ALLSELECTED('Date'),
'Date'[Date] <= max('Date'[Date]) && 'Date'[Date] <=today())

 

 

if there is due and it need to be carried fwd this should work

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@setis , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Date table should be joined with Due date and try like

 

Overduev2.2 =
CALCULATE(
SUMX(
FILTER('ALL$Cust_ Ledger Entry', (ISBLANK('ALL$Cust_ Ledger Entry'[Posting date DCLE])||
'ALL$Cust_ Ledger Entry'[Posting date DCLE] > 'ALL$Cust_ Ledger Entry'[Due Date])), [OpenSales]),
FILTER(ALLSELECTED('Date'),
'Date'[Date] <= max('Date'[Date]) && 'Date'[Date] <=today())

 

 

if there is due and it need to be carried fwd this should work

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@Greg_Deckler and @amitchandak thanks for your answers. 

 

@amitchandak your suggestion does exactly what I was looking for.  Thanks!

@amitchandak and @Greg_Deckler  I'm sorry, I was too quick saying that this worked.  Here is a dummy table trying to reproduce the issue and here is a file with the table: https://drive.google.com/file/d/1lGVOjPH3o2sLd0Lk9InO9IBgrligCvjH/view?usp=sharing 

 

Doc NrDue DatePosting dateAmount

10102-05-201905-07-2019500
10207-06-201912-06-2019200
10309-08-201905-05-2020800

 

What I intend to show is the amount for the Doc Nr 101 carried from the May-2019 to June-2019 (or from due date to posting date if the granularity is at day level)

 

 

Greg_Deckler
Community Champion
Community Champion

@setis Can you post sample data as text and expected output? Much easier to mock up a solution that way.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.