Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
We need a calculated Column/Measure that can calculate the time difference excluding the overlapping time between two Timestamp Columns: Start Time and End Time.
Each Row represents an event in the table. The Output (Minutes) column [Time Format – Minutes] is our desired output and the total is the calculated sum of the Output we need in Minutes format.
Basically, when there is any overlapping of time, we consider the start time stamp of first overlapped event and the end timestamp of last overlapped event.
For Example: Event 7 starts at 13:40PM on 28th and ends at 16:00PM of the same date. The Output can be 140 Minutes Time difference, but we have Event 8 that starts at 15:00PM which has overlapped between with the timing /Duration of Event 7. It ends at 17:50PM. Hence, we will take start time of Event 7 and End time of Event 8 and calculate the time difference that is 250 Minutes. This calculation goes on throughout the table.
Kindly help with the Calculation
Warm Regards.
Solved! Go to Solution.
Hi, @sushmitasur4
First of all,
Here is a reference, I did some processing to your data, you can use [Date]+[Time] to get the [Date/Time] Column:
Add an index column for identification:
Sort =
SWITCH (
TRUE (),
'Table'[Event Num] IN { 1, 2 }, "1",
'Table'[Event Num] = 3, "2",
'Table'[Event Num] IN { 4, 5, 6 }, "3",
'Table'[Event Num] IN { 7, 8 }, "4"
)
Then create a calculate table:
Table 2 =
FILTER (
CROSSJOIN (
SELECTCOLUMNS ( 'Table', "Sort1", 'Table'[Sort], "Start1", 'Table'[Start] ),
SELECTCOLUMNS ( 'Table', "Sort2", 'Table'[ Sort], "End2", 'Table'[End] )
),
[Sort1] = [Sort2]
)
At last, add a table visual, The result is as follow:
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @sushmitasur4
First of all,
Here is a reference, I did some processing to your data, you can use [Date]+[Time] to get the [Date/Time] Column:
Add an index column for identification:
Sort =
SWITCH (
TRUE (),
'Table'[Event Num] IN { 1, 2 }, "1",
'Table'[Event Num] = 3, "2",
'Table'[Event Num] IN { 4, 5, 6 }, "3",
'Table'[Event Num] IN { 7, 8 }, "4"
)
Then create a calculate table:
Table 2 =
FILTER (
CROSSJOIN (
SELECTCOLUMNS ( 'Table', "Sort1", 'Table'[Sort], "Start1", 'Table'[Start] ),
SELECTCOLUMNS ( 'Table', "Sort2", 'Table'[ Sort], "End2", 'Table'[End] )
),
[Sort1] = [Sort2]
)
At last, add a table visual, The result is as follow:
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
118 | |
76 | |
47 | |
45 | |
32 |
User | Count |
---|---|
172 | |
90 | |
66 | |
46 | |
45 |