Forum Discussion
Dynamic AR Aging Not working on Customer Level
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)
- Controller1233 years agoFrequent Visitor
Anonymous Do you have an update on my question?