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
ArtNo1000
Regular Visitor

Measure over due invoices over time

Hi 

 

I want to build a report to measure how much over due invoices we have had a time. I'm new to DAX and have figured out how to make an accumulated measure by filter the calender table, however I cant figure out how make a new filter after that for the Invoice-table. Any suggestions?

My table looks like this and I want the result below

 

InvoiceInvoice DateDue DatePaid DateValue
12019-01-012019-01-312019-05-15100
22019-02-012019-03-032019-02-28100
32019-03-012019-03-31 100
42019-04-012019-05-01 100
52019-05-012019-05-162019-06-05100
62019-06-012019-07-01 100

 

 

Invoice2019-012019-022019-032019-042019-052019-06
1 100100100  
2      
3   100100100
4    100100
5    100 
6      
Total overdue0100100200300200

 

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @ArtNo1000 ,

 

We can use the following measure to meet your requirement:

 

Measure Value = 
SUMX (
    DISTINCT ( 'Table'[Invoice] ),
    IF(CALCULATE(MAX('Table'[Paid Date])) = BLANK() && MIN('Calendar'[Date]) >= CALCULATE(MIN('Table'[Due Date])),CALCULATE(SUM('Table'[Value]))
    ,IF(NOT(OR(MAX('Calendar'[Date])<=CALCULATE(MIN('Table'[Due Date])),MIN('Calendar'[Date]) >= DATE(YEAR(CALCULATE(MAX('Table'[Paid Date]))),MONTH(CALCULATE(MAX('Table'[Paid Date]))),1)-1)),CALCULATE(SUM('Table'[Value])),BLANK()))
    
)

 

7.jpg


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @ArtNo1000 ,

 

We can use the following measure to meet your requirement:

 

Measure Value = 
SUMX (
    DISTINCT ( 'Table'[Invoice] ),
    IF(CALCULATE(MAX('Table'[Paid Date])) = BLANK() && MIN('Calendar'[Date]) >= CALCULATE(MIN('Table'[Due Date])),CALCULATE(SUM('Table'[Value]))
    ,IF(NOT(OR(MAX('Calendar'[Date])<=CALCULATE(MIN('Table'[Due Date])),MIN('Calendar'[Date]) >= DATE(YEAR(CALCULATE(MAX('Table'[Paid Date]))),MONTH(CALCULATE(MAX('Table'[Paid Date]))),1)-1)),CALCULATE(SUM('Table'[Value])),BLANK()))
    
)

 

7.jpg


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Refer to blog on similar line:

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

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
Community Champion
Community Champion

Check out Open Tickets. It provides a way of determining a calculation by time period given two dates (start and end date). 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364#M147



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.