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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
digicontrolling
Frequent Visitor

DAX Formula to Analyze Invoice Payment Status at Specific Dates

Problem Statement: I am working with invoice data and want to categorize invoices based on their payment status as of specific dates. I would like to select a specific date from a Date dimension table and see how the situation looked at that particular moment. Additionally, I want to display how the payment status categories evolved over time.

Requirements:

  1. Categorize invoices based on the age of the unpaid amount as of a specific date.
  2. Select a specific date from a Date dimension table to analyze the payment status as of that date.
  3. Display the evolution of the payment status categories over time.

Sample Data Structure: Here's a simplified example of the data:


InvoiceNumber  InvoiceDate   PaymentDate   InvoiceAmount   PaymentAmount   
101.01.2315.03.2310050
215.02.2310.04.23200200
315.03.23(null)1500

Objective: I want to create a measure that takes into consideration the selected date from the Date dimension table and categorizes the invoices accordingly. For example, if the selected date is 31.03.23, the measure should consider only the payments made up to that date and ignore the future payments.

Categories:

  • "0-30 Days Due": If the unpaid amount is due for 0-30 days as of the selected date.
  • "31-60 Days Due": If the unpaid amount is due for 31-60 days as of the selected date.
  • "Over 60 Days Due": If the unpaid amount is due for over 60 days as of the selected date.
  • "Paid": If the invoice is paid as of the selected date.

I appreciate any insights or guidance on how to achieve this using DAX in Power BI. Feel free to provide a simplified solution if necessary.

1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

@digicontrolling I hope this helps you. Thank You.

Max Date = MAX(Slicer Date) / Min Date = MIN(Slicer Date)
E.g 
0-30 = calculate(
                [Total Sales],
                Filter(
                         ALL( Payments[Date] ),
                         Datediff ( Payments[Date]<[Max Date]/[Min Date] ) >=0
                         &&

                         Datediff ( Payments[Date]<[Max Date]/[Min Date] ) <31
                        )
)

View solution in original post

1 REPLY 1
Mahesh0016
Super User
Super User

@digicontrolling I hope this helps you. Thank You.

Max Date = MAX(Slicer Date) / Min Date = MIN(Slicer Date)
E.g 
0-30 = calculate(
                [Total Sales],
                Filter(
                         ALL( Payments[Date] ),
                         Datediff ( Payments[Date]<[Max Date]/[Min Date] ) >=0
                         &&

                         Datediff ( Payments[Date]<[Max Date]/[Min Date] ) <31
                        )
)

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.