Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a table of employees where I need to calculate the difference between predicted hours and actual hours. Taking into account that there can be negative hours (when the predicted time is greater than the actual time), how can I do a dax measurement to calculate this value without Power BI changing the time format?
In the case of the example, I would like to show: -19:33:57
Solved! Go to Solution.
@pedromenu Generally you will need to convert those to seconds, add/subtract them and essentially convert them back more or less. And use a custom format string to preserve the format. Sample source data would help here to be more specific.
Look at the links below, they should get you what you need.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486
https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92
@pedromenu Generally you will need to convert those to seconds, add/subtract them and essentially convert them back more or less. And use a custom format string to preserve the format. Sample source data would help here to be more specific.
Look at the links below, they should get you what you need.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486
https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |