Forum Discussion
Aging Metric per Day Over Time
Hi there,
Assuming a dataset has records with open and close dates, I am looking to create a metric calulating the percentage of records close within 365 days (including open records that have been open for less than or equal to 365 days) per day over time.
With the below sample data:
Formulas:
5 Replies
- amitchandak
Super User
MikePowerBI , create an independent date table. These two measures should help, when you select a date from date table
Aging Days GT 365 days = countx(filter( addcolumns( summarize(filter('Test Data','Test Data'[Open Date] <= max('Date'[Date]) && (isblank('Test Data'[Close Date]) || 'Test Data'[Close Date] >= max('Date'[Date]) )) , 'Test Data' [Record]), "_1", IF(max('Test Data'[Close Date]) = BLANK(), DATEDIFF(min('Test Data'[Open Date]), TODAY(), DAY), DATEDIFF(,min('Test Data'[Open Date]),min(maxx(allselected('DAte'),'Date'[Date]),Max( 'Test Data'[Close Date],DAY)))) ), [_1]<= 365),[Record])
Total Open = countrows(summarize(filter('Test Data','Test Data'[Open Date] <= max('Date'[Date]) && (isblank('Test Data'[Close Date]) || 'Test Data'[Close Date] >= max('Date'[Date]) )) , 'Test Data' [Record]))- MikePowerBI
Helper II
Hi amitchandak thank you for the prompt reply, I appreciate it!
I received an error with the Aging Days GT 365 Days measure saying "too few arguements were passed to the DATEDIFF funtion" if I keep the comma in "DATEDIFF(,MIN" and then I get the error "too few arguements were passed to the DAY funtion" if I remove it. Could you help with this error please?
Additionally, would the aging percentage be calculated by taking Aging Days GT 365 Days/Total Open?
- Ashish_Mathur
Super User
Hi,
Share the link from where i can download your PBI file.
- MikePowerBI
Helper II
Hi Ashish_Mathur thank you for the reply!
Please let me know if you are unable to download the file from this link.
https://www.dropbox.com/s/r45mzkuq6g97u8b/Test%20Data.pbix?dl=0
- Ashish_Mathur
Super User
Hi,
I have not replied because i have not been able to understand your requirement despite your clear explanation. May be someone else can understand your requirement.