Forum Discussion
Dynamic Accounts Receivable Aging
- 8 years ago
Hi tlenzmeier,
If you want to keep the previous measure [PastDue], you can add another one:
Buckets = SWITCH ( TRUE (), ISBLANK ( [PastDue] ), "Current", [PastDue] >= 1 && [PastDue] <= 30, "Bucket1", [PastDue] >= 31 && [PastDue] <= 60, "Bucket2", [PastDue] >= 61 && [PastDue] <= 90, "Bucket3", [PastDue] >= 91, "Bucket4",
"Error" )If you only want one measure, you can use this one:
Buckets In One = VAR SelectedDate = IF ( HASONEVALUE ( 'Indicator'[Date] ), VALUES ( 'Indicator'[Date] ), BLANK () ) VAR PastDue = IF ( MIN ( 'Invoice'[ InvoiceDueDate] ) >= SelectedDate || ISBLANK ( SelectedDate ), BLANK (), DATEDIFF ( MIN ( 'Invoice'[ InvoiceDueDate] ), SelectedDate, DAY ) ) RETURN SWITCH ( TRUE (), ISBLANK ( [PastDue] ), "Current", [PastDue] >= 1 && [PastDue] <= 30, "Bucket1", [PastDue] >= 31 && [PastDue] <= 60, "Bucket2", [PastDue] >= 61 && [PastDue] <= 90, "Bucket3", [PastDue] >= 91, "Bucket4",
"Error" )Best Regards,
Dale
- 8 years ago
You are welcome.
If you want to add the buckets as column headers, I'm afraid it's too hard. The visual could be Matrix. Let's make some explanations.
1. There aren't any buckets in the source tables. They are dynamic.
2. The dynamic values can't be added in the column. Maybe we can create a new table of all the buckets. The problem is we can't create a relationship with the tables we have now.
Maybe there is a workaround. I would suggest you create a new thread in this forum to focus on this need.
Thank you for accepting my answer.
Best Regards,
Dale
You are welcome.
If you want to add the buckets as column headers, I'm afraid it's too hard. The visual could be Matrix. Let's make some explanations.
1. There aren't any buckets in the source tables. They are dynamic.
2. The dynamic values can't be added in the column. Maybe we can create a new table of all the buckets. The problem is we can't create a relationship with the tables we have now.
Maybe there is a workaround. I would suggest you create a new thread in this forum to focus on this need.
Thank you for accepting my answer.
Best Regards,
Dale
I have succeded in having the buckets made by doing this:
Receivables Overdue Buckets =
SWITCH (
TRUE ();
[Receivables datediff] <= 0; "0 Days";
[Receivables datediff] > 0
&& [Receivables datediff] <= 14; "1-14 Days Overdue";
[Receivables datediff] > 14
&& [Receivables datediff] <= 30; "15-30 Days Overdue";
[Receivables datediff] > 30
&& [Receivables datediff] <= 90; "31-90 Days Overdue";
[Receivables datediff] > 90
&& [Receivables datediff] <= 360; "91-360 Days Overdue";
[Receivables datediff] > 360
&& [Receivables datediff] < 1000000; "Over 360 Days Overdue";
"Error"
)
That also works when put in rows, but I cant use it in a chart as X-axis, or as columns in a Matrix. Is there any way around that?