Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hello,
I am trying to build a series of measures for a report that will dynamically calculate the AR aging by buckets (current, <15 days overdue, 16-30 days overdue, 31-90 days overdue, 90+ overdue) based on a slicer. I have the following set up:
1) Date reference table
2) Transaction table with the following key fields: Transaction Date (of sale), Due Date, and Closed Date. If something is not yet paid, and thus active AR, the closed date has a future date. That is the way the system is set up.
3) Measure #1
This measure seems to be working on an invoice by invoice basis, but it doesn't work when summed up. See below for an exmaple when the slicer is set on October 16th:
However, when I try to do a summary table (I want to see the sum of all invoices by each bucket, for example $60k are current, $8k are <15, etc.) but it all buckets it into current. Can someone help fix this measure?
Hi @Controller123 ,
According to your statement, I know [Invoice Aging] should be a measure. Measure will only show aggregate value as your screenshot. So this measure will work by invoice basis and will only show one bucket "Current" when you remove invoice column.
Currently you want to show the sum of all invoices by each bucket, I suggest you to add an unrelated bucket table with all aging bucket into your data model.
Then try this measure.
New_Sales =
VAR _SUMMARIZRE =
SUMMARIZE (
'Sales and Collections',
'Sales and Collections'[INVOICE],
'Sales and Collections'[Sales],
"Invoice Aging",
VAR CurrentDate =
CALCULATE (
MAX ( 'Reference Dates'[Date] ),
USERELATIONSHIP ( 'Reference Dates'[Date], 'Sales and Collections'[CLOSED] )
)
VAR AgingDifference =
CALCULATE (
DATEDIFF ( MAX ( 'Sales and Collections'[DUEDATE] ), CurrentDate, DAY ),
ALL ( 'Reference Dates'[Date] ),
'Sales and Collections'[CLOSED] > CurrentDate,
'Sales and Collections'[TRANSDATE] <= CurrentDate
)
VAR AgingBucket =
IF (
ISBLANK ( AgingDifference ),
BLANK (),
IF (
AgingDifference <= 0,
"Current",
IF (
AgingDifference <= 15,
"<=15",
IF (
AgingDifference <= 30,
"16-30",
IF (
AgingDifference <= 90,
"31-90",
IF ( AgingDifference > 90, ">90", BLANK () )
)
)
)
)
)
RETURN
AgingBucket
)
RETURN
SUMX (
FILTER ( _SUMMARIZRE, [Invoice Aging] = MAX ( 'Invoice Aging'[Invoice Aging] ) ),
[Sales]
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey @Anonymous . Thanks for the proposed solution. I shifted this Invoice Aging metric to a table named Invoice Aging. The table looks like this:
When I pasted your formula into a new measure in this table, i get the following errors:
1)
2)
How can i fix these errors?
For reference, here is the sales measure that is causing the issue, which sums up the amount for every transaction type but 15 (which is payments)
@Anonymous Do you have an update on my question?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!