Forum Discussion
Calculating date range of availability
Hi
I am attempting to display a date range of the next availability for an employee relative to todays date
I have 2 tables
1) A Fact table detailing employee id and availability
2) A Date table
| Date | Employee ID | Availability Status |
07/05/2023 | 1 | Available |
| 08/05/2023 | 1 | Available |
| 09/05/2023 | 1 | Available |
| 10/05/2023 | 1 | Available |
| 11/05/2023 | 1 | On Project |
| 12/05/2023 | 1 | On Project |
| 13/05/2023 | 1 | On Project |
| 14/05/2023 | 1 | On Project |
| 15/05/2023 | 1 | Available |
| 16/05/2023 | 1 | Available |
| 17/05/2023 | 1 | Available |
| 18/05/2023 | 1 | Available |
| 19/05/2023 | 1 | Available |
| 20/05/2023 | 1 | Available |
| 21/05/2023 | 1 | Available |
| 22/05/2023 | 1 | Available |
| 23/05/2023 | 1 | Available |
| 24/05/2023 | 1 | On Project |
| 25/05/2023 | 1 | On Project |
| 26/05/2023 | 1 | On Project |
| 27/05/2023 | 1 | On Project |
| 28/05/2023 | 1 | Available |
| 29/05/2023 | 1 | Available |
| 30/05/2023 | 1 | Available |
If todays date is 16/05/2023 I need to produce a visualisation that shows the following (the data is as above).
| Employee ID | Available Date Start | Available Date Finish |
| 1 | 15/05/2023 | 23/05/2023 |
If todays date is 21/05/2023 I need to produce a visualisation that shows the following (the data is as above).
| Employee ID | Available Date Start | Available Date Finish |
| 1 | 15/05/2023 | 23/05/2023 |
If todays date is 28/05/2023 I need to produce a visualisation that shows the following (the data is as above).
| Employee ID | Available Date Start | Available Date Finish |
| 1 | 28/05/2023 | 30/05/2023 |
Any help would be appreciated. Thanks
pls see my video
https://1drv.ms/v/s!AiUZ0Ws7G26RiBEtRvV4-dWv2KuV?e=8jy0VmSample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RiBBrBBVTtvgomzh2?e=C1SLAD
2 Replies
- Ahmedx
Super User
pls see my video
https://1drv.ms/v/s!AiUZ0Ws7G26RiBEtRvV4-dWv2KuV?e=8jy0VmSample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RiBBrBBVTtvgomzh2?e=C1SLAD- Richard_Halsall
Helper IV
Perfect many thanks