
Creator III
2023-08-08
01:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Show maximum number of average days between two date columns in a textbox
I have ID, Start Date, End Date.
I need to show the maximum average number of days between start date and end date in a text box.
I already know how to calculate individual average # of days between Start and End dates using
aggr(avg((date( [Start Date]- [End Date]))),ID)
I need to show the highest value of this expression (Highest avg days) in a textbox
427 Views
1 Reply

Partner - Creator III
2023-08-08
04:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I created some test data with the solution, confirm if it is what you need:
Data:
LOAD * INLINE [
ID, StartDate, EndDate
1, 2023-01-01, 2023-01-05
2, 2023-02-01, 2023-02-10
3, 2023-03-01, 2023-03-05
4, 2023-04-01, 2023-04-20
5, 2023-05-01, 2023-05-15
];
Measure:
max(aggr(avg(Date([EndDate]) - Date([StartDate])), ID))
Image:
Regarts.
https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
405 Views
