Forum Discussion
Create an additive measure on a Date/Time column
Hello Experts,
I have 4 columns in my dataset that looks like the below:
| ID | Created_Date | Total_Duration_minutes | Status |
| 1 | 01/01/2025 07:00:00 | 120 | Open |
| 1 | 01/01/2025 07:00:00 | 60 | Validated |
| 1 | 01/01/2025 07:00:00 | 30 | In progress |
| 2 | 12/28/2024 10:30:00 | 10 | Open |
| 2 | 12/28/2024 10:30:00 | 60 | Validated |
I would like to create a measure that will provide the below output:
| ID | Created_Date | Total_Duration | Date_After_Addition |
| 1 | 01/01/2025 07:00:00 | 210 | 01/01/2025 10:30:00 |
| 2 | 12/28/2024 10:30:00 | 70 | 12/28/2024 11:40:00 |
My measure should cumulate the values in the Total_Duration_minutes column and provide the final date/time after adding the sum of the total_duration_minutes to the created_date column for each ID. Please also note that my measure should respect the filtering context of the Status column. So, in case I filter out the value "Validated", the output for ID(1) should look like the below:
| ID | Created_Date | Total_Duration | Date_After_Addition |
| 1 | 01/01/2025 07:00:00 | 150 | 01/01/2025 09:30:00 |
If the solution requires the creation of a calculated table, that's fine too!
Thank you in advance!
Hy MaJar
You can also get your desire output by using these 2 measures in your report.Total_Duration = SUM('Table'[Total_Duration_minutes])Date_After_Addition = MIN('Table'[Created_Date]) + ([Total_Duration] / 1440)Best Regards,
Muhammad YousafIf this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.
MaJar
If you add the status in your visual, it will be part of the grouping, use the first DAX formula if you need to keep only one line per ID
6 Replies
- MaJarFrequent Visitor
Hi,
Unfortunately, with this option, I loose the option to filter out the time spent on some status and the final time added will always be the same when I filter out some values.
Thank you!
- MaJarFrequent Visitor
Hello Fowmy,
Thank you very much for your input.
I still need to have the ID and Status columns in my table. Once I add them into the table following your logic, the grouping doens't work and the measure are treating every row separately and not grouped by ID.
Can you advice what should I do to have the output table as I published in my post.Thank you in advance
- muhammad_786_1
Solution Supplier
Hy MaJar
You can also get your desire output by using these 2 measures in your report.Total_Duration = SUM('Table'[Total_Duration_minutes])Date_After_Addition = MIN('Table'[Created_Date]) + ([Total_Duration] / 1440)Best Regards,
Muhammad YousafIf this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.