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 moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Hello. I have been on this problem for nearly two days. I've searched on this forum and others for an answer. Have tried all manner of calcs using SUMX, CALCULATE, GROUP, EVALUATE, SUMMARIZE, FILTER the list goes on.
The below table is a screenshot for Employee A (we have hundreds) and how many hours a day they work. For this, I just pulled in the Hours field and chose DON'T SUMMARIZE. This is correct:-
Now, do you think I can make those hours add up correctly for January (should be 146.74, Mon to Fri, 23 days @ 6.38):-
Using SUM, AVERAGE..... nothing.
The data source is a custom CTE sql joining two tables, hence why I tried the above DAX options.
Have tried using a Calendar Table, but nothing.
Many thanks for your help in advance. 🙂
Solved! Go to Solution.
Hello @Power_It_Up ,
what if you extracted the month from the date and show the sum of hours by month, wouldn't this work ?
add a calculated column to get the month:
month name = format( datecolumn,"MMMM")
Proud to be a Super User! | |
i think you need convert you hours column in seconds, than sum, and convert again in hours.
Hi, @Power_It_Up
Based on your information, I create a sample table:
Then create a new measure and try the following dax:
TotalHours =
CALCULATE(
SUM('Table'[Hours]),
FILTER(
'Table',
'Table'[Attend Date] >= DATE(2024, 1, 1) &&
'Table'[Attend Date] <= DATE(2024, 1, 31) &&
WEEKDAY('Table'[Attend Date], 2) <= 5
)
)
Here is my preview:
The reason why the January data is different from your 146.74 is because I see that you have a holiday on January 1st and New Year's Day, so the total number of working days this month is 22 days, and it is not counted as 23 days.
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Idrissshatila @LeandroDeodato @Anonymous
Thank you all for your suggestions, which I applied but still couldn't quite get the calc to work.
I decided to dismantle the merge join and split them into separate tables and applying a relationship between them. This fixed the issue. Thanks again. 🙂
Hi, @Power_It_Up
Based on your information, I create a sample table:
Then create a new measure and try the following dax:
TotalHours =
CALCULATE(
SUM('Table'[Hours]),
FILTER(
'Table',
'Table'[Attend Date] >= DATE(2024, 1, 1) &&
'Table'[Attend Date] <= DATE(2024, 1, 31) &&
WEEKDAY('Table'[Attend Date], 2) <= 5
)
)
Here is my preview:
The reason why the January data is different from your 146.74 is because I see that you have a holiday on January 1st and New Year's Day, so the total number of working days this month is 22 days, and it is not counted as 23 days.
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
i think you need convert you hours column in seconds, than sum, and convert again in hours.
Hello @Power_It_Up ,
what if you extracted the month from the date and show the sum of hours by month, wouldn't this work ?
add a calculated column to get the month:
month name = format( datecolumn,"MMMM")
Proud to be a Super User! | |
Check out the May 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 |
|---|---|
| 21 | |
| 21 | |
| 21 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 56 | |
| 53 | |
| 49 | |
| 26 | |
| 25 |