Forum Discussion
Calculating receivable aging dynamically
- Anonymous1 year ago
Thanks for the reply from ajohnso2 and johnt75 , please allow me to provide another insight:
Hi, voidbydefault
Could you please let me know if the responses from ajohnso2 and johnt75 have resolved your issue? If they have, kindly accept their answers as the solution
I share the same views as ajohnso2 and johnt75, and I’ve created examples based on their perspectives to aid your understanding. Below are my sample data:
1.First, ajohnso2's proposal:
This modifies the final step of your approach by adjusting the measures:
xDays Outstanding = DATEDIFF(MAX('data_006_custBal'[Invoice Due Date]), [Aging Cutoff Date], DAY)Here are the final results:
2.Second, johnt75 's proposal:
Firstly, create the following two measures:
Measure 1 = DATEDIFF(MAX('data_006_custBal'[Invoice Due Date]),MAX('data_006_custBal'[Report Date]),DAY)Measure 2 = DATEDIFF(MAX('data_006_custBal'[Invoice Due Date]),TODAY(),DAY)Then, create the parameters:
Rename them accordingly and create the slicer:
Parameter = { ("Report Date", NAMEOF('data_006_custBal'[Measure 1]), 0), ("Today", NAMEOF('data_006_custBal'[Measure 2]), 1) }
Here are the final results:
I hope my explanations help you grasp their proposals. Both solutions are excellent ideas, and I trust you will find them useful.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
- 1 year ago
First, thanks to johnt75 , ajohnso2 , and Anonymous for your time in trying to help. In my unique case, I realized I need to calculate invoice aging at row level so I added four columns in my data table as:
Then created a parameter with its slicer:
test_OS_Days = { ("xDays Outstanding from Report Date", NAMEOF('data_006_custBal'[xAging Bucket Report Days]), 0), ("xDays Outstanding from Today", NAMEOF('data_006_custBal'[xAging Bucket Today Days]), 1) }This enabled the functionality I was aiming to achieve.
Many thanks, Leroy. Their tips were helpful, but your explanation plus demo nailed it, so I accepted yours as the solution.
One question, though: is it important to have all the measures, like `Measure 1`, `Measure 2`, `xDays Outstanding`, and `Aging Cutoff Date`, in table `data_006_custBal`? I usually prefer to have measures separated in a table created using DAX called "BI_calcs" to keep my calculations separate from data tables.
Thanks again.
Edit 1: One observation is that the solution is only working if measures can see details like invoice due date to have a context to do the calculations. If I remove details like customer ID and invoice date, then "xDays Outstanding" goes bonkers. One of my aims is to have a visual showing days grouped into buckets like 0-90, etc., with balances only, so this is an emerging issue to solve.
Edit 2: "xDays Outstanding" is unusable in bar chart visualization as x-axis. The second proposal using parameters works, but the outcome is affected by issue mentioned in "Edit 1" above.