Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi guys,
Intention is to have the Diff hours based on Date cut off
Need help to calculate the following Duration_Mins. Currently at Row 5. the StartTimeStamp (17th Jul 23:17) and EndTimeStamp (18th 02:09) goes over to next day. Therefore the Duration Mins calculated based on StartTimeStamp does not return the correct value based on Date cut off due to cross days.
Total Hours for 17th Jul is 26:09 hours where 18th Jul is 21:50 hours.
One wish list is to have as below, but i have millions of records in table.
But how to implement in Power BI? I m not able to change the data ingestion at table. Only allowed to do changes at Power BI level.
Or is there any better method to implement ?
Thank you
Solved! Go to Solution.
Step 0: I use these data and calculate by 'Minutes'.
Step 1: I duplicate the 'Duration_Mins' column.
Step 2: I chande the type of 'Duration_Mins - Copy' column.
'Duration_Mins - Copy' column: 'Time' --> 'Decimal Number'
Step 3: I rename the 'Duration_Mins - Copy' column.
'Duration_Mins - Copy' --> 'Duration_Day'
Step 4: I add a 'Duration_Min' column and change the type of the column.
Step 5: I add a 'Day' column and rename it. ('Day' --> 'S_Day')
Step 6: I add a 'Day' column and rename it. ('Day' --> 'E_Day')
Step 7: I add the 'Flag' column.
Step 8: I unpivot 'StartTimeStamp' and 'EndTimeStamp' columns.
- Before -
- After -
Step 8: I add a column and make a matrix.
- Matrix -
Step 0: I use these data and calculate by 'Minutes'.
Step 1: I duplicate the 'Duration_Mins' column.
Step 2: I chande the type of 'Duration_Mins - Copy' column.
'Duration_Mins - Copy' column: 'Time' --> 'Decimal Number'
Step 3: I rename the 'Duration_Mins - Copy' column.
'Duration_Mins - Copy' --> 'Duration_Day'
Step 4: I add a 'Duration_Min' column and change the type of the column.
Step 5: I add a 'Day' column and rename it. ('Day' --> 'S_Day')
Step 6: I add a 'Day' column and rename it. ('Day' --> 'E_Day')
Step 7: I add the 'Flag' column.
Step 8: I unpivot 'StartTimeStamp' and 'EndTimeStamp' columns.
- Before -
- After -
Step 8: I add a column and make a matrix.
- Matrix -
I will try and update you soon.. thanks
You could use the Duration functions in Power Query? As part of your import, create a new column which uses Duration.Minutes. Would look something like: "Duration.Minutes([EndTimeStamp] - [StartTimeStamp])
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
68 | |
58 | |
51 | |
36 | |
34 |
User | Count |
---|---|
84 | |
71 | |
56 | |
45 | |
43 |