This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi Team,
I want to calculate difference in minutes for each one hour.
If an employee logs in at 8:30 and logs out at 11:30, we want to calculate the time spent for each hourly interval. Here's how it should look:
For the 8-9 interval: 30 minutes
For the 9-10 interval: 60 minutes
For the 10-11 interval: 60 minutes
For the 11-12 interval: 30 minutes (because the logout time is at 11:30)
Sample data
| Emp Id | Emp Name | Job Title | Log In Time | Log Out Time | Dif in min | HourlyInterval |
| 123 | Hari | Manager | 5/2/2024 8:25 | 5/2/2024 11:00 | 155 | 08-09 |
| 123 | Hari | Manager | 5/2/2024 8:20 | 5/2/2024 8:25 | 5 | 08-09 |
| 123 | Hari | Manager | 5/2/2024 11:34 | 5/2/2024 11:49 | 15 | 11-12 |
| 123 | Hari | Manager | 5/2/2024 11:17 | 5/2/2024 11:32 | 15 | 11-12 |
For record #1:
Please provide expected result using the sample data.
Business requirement is to track how many hours he was in online. And I am not expecting in the row I am adding this in matrix visual
I asked because you mentioned that "we want to calculate the time spent for each hourly interval" which I assumed you wanted to show each interval as a row.
I tried with this dax but not getting expected result
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 35 | |
| 29 | |
| 23 | |
| 22 |