Forum Discussion
Splitting time duration between over months
- 1 year ago
Hi
I'm still looking for a solution to this.
Does anyone have any ideas?
It would be much appreciatedThanks
IAShakir Ensure you have a date table in your model. If not, create one.
Use DAX to create a calculated table that splits the outage duration into daily segments.
dax
OutageDailyBreakdown =
VAR OutageTable = 'YourOutageTable'
VAR DateTable = 'YourDateTable'
RETURN
ADDCOLUMNS(
FILTER(
CROSSJOIN(OutageTable, DateTable),
DateTable[Date] >= OutageTable[Outage start GMT] &&
DateTable[Date] <= OutageTable[Outage end GMT]
),
"DailyOutageStart",
IF(DateTable[Date] = OutageTable[Outage start GMT], OutageTable[Outage start GMT], DateTable[Date]),
"DailyOutageEnd",
IF(DateTable[Date] = OutageTable[Outage end GMT], OutageTable[Outage end GMT], DateTable[Date] + 1),
"DailyOutageMinutes",
DATEDIFF(
IF(DateTable[Date] = OutageTable[Outage start GMT], OutageTable[Outage start GMT], DateTable[Date]),
IF(DateTable[Date] = OutageTable[Outage end GMT], OutageTable[Outage end GMT], DateTable[Date] + 1),
MINUTE
)
)
bhanu_gautam Thank you for getting back to me so quickly
| Service Name | Outage start GMT | Outage end GMT | Outage.Days | Outage.Hours | Outage.Minutes | Outage duration (mins) | Date | DailyOutageStart | DailyOutageEnd | DailyOutageMinutes |
| Network LAN & Wireless | 02/08/2024 17:53 | 05/08/2024 15:38 | 2 | 21 | 45 | 4185 | 05/08/2024 00:00 | 05/08/2024 00:00 | 06/08/2024 00:00 | 1440 |
| Network LAN & Wireless | 02/08/2024 17:53 | 05/08/2024 15:38 | 2 | 21 | 45 | 4185 | 04/08/2024 00:00 | 04/08/2024 00:00 | 05/08/2024 00:00 | 1440 |
| Network LAN & Wireless | 02/08/2024 17:53 | 05/08/2024 15:38 | 2 | 21 | 45 | 4185 | 03/08/2024 00:00 | 03/08/2024 00:00 | 04/08/2024 00:00 | 1440 |
| SERVICEREQID | Service Name | Outage start GMT | Outage end GMT | Outage.Days | Outage.Hours | Outage.Minutes | Outage duration (mins) | Date | DailyOutageStart | DailyOutageEnd | DailyOutageMinutes |
| IT205901 | Remote Access - VPN | 28/02/2025 00:00 | 05/03/2025 00:00 | 5 | 0 | 0 | 7200 | 05/03/2025 00:00 | 05/03/2025 00:00 | 05/03/2025 00:00 | 0 |
| IT205901 | Remote Access - VPN | 28/02/2025 00:00 | 05/03/2025 00:00 | 5 | 0 | 0 | 7200 | 04/03/2025 00:00 | 04/03/2025 00:00 | 05/03/2025 00:00 | 1440 |
| IT205901 | Remote Access - VPN | 28/02/2025 00:00 | 05/03/2025 00:00 | 5 | 0 | 0 | 7200 | 03/03/2025 00:00 | 03/03/2025 00:00 | 04/03/2025 00:00 | 1440 |
| IT205901 | Remote Access - VPN | 28/02/2025 00:00 | 05/03/2025 00:00 | 5 | 0 | 0 | 7200 | 02/03/2025 00:00 | 02/03/2025 00:00 | 03/03/2025 00:00 | 1440 |
| IT205901 | Remote Access - VPN | 28/02/2025 00:00 | 05/03/2025 00:00 | 5 | 0 | 0 | 7200 | 01/03/2025 00:00 | 01/03/2025 00:00 | 02/03/2025 00:00 | 1440 |
| IT205901 | Remote Access - VPN | 28/02/2025 00:00 | 05/03/2025 00:00 | 5 | 0 | 0 | 7200 | 28/02/2025 00:00 | 28/02/2025 00:00 | 01/03/2025 00:00 | 1440 |
Apologies if I wasn't clear
Thanks in advance
Kind regards
Imran