Forum Discussion
ghouse_peer
6 years agoPost Patron
Duration Days
Hello guys, I need to calculate and display the duration days. The calculation is I have a 2 tables: 1) 'Dates' table (created using calendarauto()) 2) 'Tic...
- 6 years ago
The first block of M code is not a measure but an example of how to create the Duration column. Basically, in the query editor on the Add Column tab, click on Custom Column and then put an expression like this in the pop up box, substituting your actual column names in.
= if [Ticket Closed Date] = null then Duration.TotalHours([Restored Date]-[Ticket Opened Date])/24 else Duration.TotalHours([Ticket Closed Date]-[Ticket Opened Date])/24Then, hit Close & Apply to load the data with the new column, and then click on New Column in the ribbon and enter the DAX expression to get your new Days Range column (follow the pattern started to add more date ranges).
Regards,
Pat
ghouse_peer
6 years agoPost Patron
mahoneypat Thanks for the solution. Got the ranges which is required. Thank you.