Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi
I need to find the highest outstanding per customer in a given period.
In my table I have invoices and payments and of course date, customer number and amount.
Do you have any suggestions?
Solved! Go to Solution.
If you create a measure like
Outstanding Amount =
VAR maxDate =
MAX ( 'Date'[Date] )
VAR invoicedAmount =
CALCULATE (
SUM ( 'Table'[Amount] ),
REMOVEFILTERS ( 'Date' ),
ALLEXCEPT ( 'Table', 'Table'[Customer No] ),
'Table'[Date] <= maxDate,
'Table'[Type] = "Invoice"
)
VAR paidAmount =
CALCULATE (
SUM ( 'Table'[Amount] ),
REMOVEFILTERS ( 'Date' ),
ALLEXCEPT ( 'Table', 'Table'[Customer No] ),
'Table'[Date] <= maxDate,
'Table'[Type] = "Payment"
)
RETURN
invoicedAmount - paidAmount
then your max outstanding amount would be
Max Outstanding = MAXX( VALUES('Date'[Date]), [Outstanding Amount])
If you create a measure like
Outstanding Amount =
VAR maxDate =
MAX ( 'Date'[Date] )
VAR invoicedAmount =
CALCULATE (
SUM ( 'Table'[Amount] ),
REMOVEFILTERS ( 'Date' ),
ALLEXCEPT ( 'Table', 'Table'[Customer No] ),
'Table'[Date] <= maxDate,
'Table'[Type] = "Invoice"
)
VAR paidAmount =
CALCULATE (
SUM ( 'Table'[Amount] ),
REMOVEFILTERS ( 'Date' ),
ALLEXCEPT ( 'Table', 'Table'[Customer No] ),
'Table'[Date] <= maxDate,
'Table'[Type] = "Payment"
)
RETURN
invoicedAmount - paidAmount
then your max outstanding amount would be
Max Outstanding = MAXX( VALUES('Date'[Date]), [Outstanding Amount])
Example 😉
So if the filtered period is 1/3/2022 - 31/3/2022 it should show row 4 and 9
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |