The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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:
Sample Data Structure: Here's a simplified example of the data:
InvoiceNumber | InvoiceDate | PaymentDate | InvoiceAmount | PaymentAmount |
1 | 01.01.23 | 15.03.23 | 100 | 50 |
2 | 15.02.23 | 10.04.23 | 200 | 200 |
3 | 15.03.23 | (null) | 150 | 0 |
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:
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.
Solved! Go to Solution.
@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
)
)
@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
)
)
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
28 | |
17 | |
11 | |
7 | |
5 |