Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Estyfodense
Helper I
Helper I

Work with hours

i'd like sum the total of hours, day by day and make a table like this 
 start timeFinal hour total hh
02/01/202018:00:0018:30:0000:30:00
02/01/202017:00:0018:00:0001:00:00
02/01/202016:00:0017:00:0001:00:00
02/01/202015:00:0016:00:0001:00:00
02/01/202014:00:0015:00:0001:00:00
02/01/202013:00:0014:00:0001:00:00
02/01/202012:00:0013:00:0001:00:00
02/01/202011:00:0012:00:0001:00:00
02/01/202010:00:0011:00:0001:00:00
02/01/202009:00:0010:00:0001:00:00
02/01/202008:00:0009:00:0001:00:00
04/01/202011:0011:3500:35:00
04/01/202010:0011:0001:00:00
04/01/202009:0010:0001:00:00
04/01/202008:0009:0001:00:00
04/01/202007:3008:0000:30:00

 

To it I'm use 

total hh =SUMX('HH,
'HH'[Final hour ]-'HH'[start time])
after this, a did I Have to create table like that
 DateHours Work totalWork by dayExtra Hour
Thursday02/01/202010:30:0008:00:0002:30:00
Saturday04/01/202004:05:0004:00:0000:05:00

I have to create a measure or Dax that identify the day, For exemple If de day is Saturday it gets the total hours and subtract per 04:00 hrs and to others day get total hours and subtract to 08:00 hrs . In the end I get the extra hour and plot a chart .
2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@Estyfodense 

Try the following formula: Make sure you do the right formatting of duration 13:30:55 (h:nn:ss)

Total Hours = 
SUMX(
    hh,
    HH[Final hour ] - HH[start time]
)
Net Total Hours = 
[Total Hours] - IF( WEEKDAY(MAX(HH[Date]),1) = 7 ,TIME(8,0,0), TIME(4,0,0))

 

Check Day, I 

Fowmy_0-1598182527004.png

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

To get the correct total, use this measure that references the solution @Fowmy

Total Net SUMX - SUMX(VALUES(HH[Date]), [Net Total Hours])

If this works for you, mark it as the solution. Praise is also appreciated. Please let me know if you don't.

Best regards

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@Estyfodense - This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

Also, these might help, a couple of quick measures I have created over the years that work with hours:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Hour-Breakdown/m-p/625085#M306

https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Duration-Working-Hours/m-p/481543#M...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Fowmy
Super User
Super User

@Estyfodense 

Try the following formula: Make sure you do the right formatting of duration 13:30:55 (h:nn:ss)

Total Hours = 
SUMX(
    hh,
    HH[Final hour ] - HH[start time]
)
Net Total Hours = 
[Total Hours] - IF( WEEKDAY(MAX(HH[Date]),1) = 7 ,TIME(8,0,0), TIME(4,0,0))

 

Check Day, I 

Fowmy_0-1598182527004.png

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

This has already helped a lot, but the total hours does not correspond could help with this problem.

To get the correct total, use this measure that references the solution @Fowmy

Total Net SUMX - SUMX(VALUES(HH[Date]), [Net Total Hours])

If this works for you, mark it as the solution. Praise is also appreciated. Please let me know if you don't.

Best regards

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you for the help of everyone, this solution can also be used.
Total Hours ?
SUMX(
Hh
HH[Final hour ] - HH[start time]
)

to correct calculate the total value ?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors