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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Calculate % of hours worked base two different working schedual using a calculated table/measure

Hello Power BI community, I will need some help for this task.

I have two working schedule, the first one include working on saturday for 8 hours whereas the second one only works for 5 hours on that day. I created a calculated column to have a full calendar (removing the sundays) and specify the number of hours per day : 

Mayassi_0-1684189355699.png

The total number of hours worked and the names are on a non calculated table.

The objective is to calculate depending on the person the % of hours worked (filtred by the number of days)

Mayassi_2-1684189646440.png

In short : I want to devide "number of hours worked" by "sum work hour normal/exception" depending on the person.
Thank you for your time and help! 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You already have that part of your table

divide(Sum(Table[Work Hour Normal]), Sum(Table[Work Hour exception]) )

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you, but this does not help me sadly ; i created a new pbix document to share in hope of help (but it seems I can't share it here).
here are examples of all table used :

ID_RRR_date 
1work101/05/2023
2work201/05/2023
3work302/05/2023
4work406/05/2023
5work506/05/2023
6work608/05/2023
ID_R_personID_Rpersontime taken (h)
11A3,00
21B3,00
32C2,00
42A3,00
54B4,00
65C3,00
75D3,00
86D4,00
96B4,00


What i need to do :

personhours spent on taskwhat i want 
A6,000,11
B11,000,20
C5,000,09
D7,000,13207547

here are the calculate column used and they DAX function :

-Calendar = CALENDAR("01/12/2022","31/12/2023")
-IsWeekday = WEEKDAY(Calendrier[Date],2) <= 6
(!) this is the one used for the filter :
-Date without sunday =
var CalendarYearMonth = Calendrier[Date]
var LoadedAtYearMonth = Calendrier[IsWeekday]=true
return
    if ( Calendrier[IsWeekday]= true,
       
        CalendarYearMonth
    )
-work hours exception = IF(WEEKDAY(Calendrier[Date],2)=6,5, IF(WEEKDAY(Calendrier[Date],2) =7,0,8))
-work hour normal = IF(WEEKDAY(Calendrier[Date],2)<=6,8,0)
these will give the total of hours worked depending on the date filter.
Mayassi_0-1684225623745.png

A,B and C needs to be divided by 56 whereas D  needs to be divided by 53. In my case I only have two people that are exception to the rule, that i can identify with their name.

I am sorry I can't share the pbix document but I did my best to help you help me, in hope of having a solution to this issue, thank you again! 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.