Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to generate hours that are allocated based on date and machine

Hi all,

 

May need your help in to solve an issue that i currently face . I am currently stuck and no idea if this is possible to do in PowerBI (currently doing it in excel and would like to automate the report ).  I have a case where we need to monitor the loading for each machine that are assigned  . So each job number will be having balance hours and days remaining for it to complete the job. I have created a calendar table that are connected to the job operation date. My main question is how do i generate hours (balancehours / days ) to get an output similar as below . 

 

 

(above is the expected out but in excel .. the chart is based on week , i would like by date so that I can monitor by weekly , month and year)

 

I have few conditions also:

-The hours divided must be within job start date (JobOper_StartDate) and end date (JobDue_Duedate) .  

-Job that are passed due date not need to generate and will go to backlog hours as shown in chart

 

So the expected output : We are able to sum the total hours divided based on date , month and also based on machine(resource) . 

 

Here are sample data for factory loading :

 

Calculated_BalanceHrsDaysJob NumJobOper_StartdateJobOper_DueDateResource
34.71217200828-Jun-2327-Jun-23CM4
20.93417263118-Sep-2315-Sep-23CM4
24.48317263207-Jul-2305-Jul-23CM3
32.78317263723-Jun-2321-Jun-23CM2
14.58217268414-Jul-2313-Jul-23CM2
6.38217268713-Jul-2312-Jul-23CM2
10.04217269407-Jul-2306-Jul-23CM2
35.18617272027-Jun-2322-Jun-23CM3
12.85217280916-Jun-2315-Jun-23CM4
6.79217281827-Jun-2326-Jun-23CM4
71.27416529424-Nov-2321-Nov-23CM1
36.76516817722-Aug-2318-Aug-23CM1
34.48617029206-Dec-2301-Dec-23CM1
34.48217029303-Nov-2302-Nov-23CM1
34.48617029404-Oct-2329-Sep-23CM1
34.48617029506-Sep-2301-Sep-23CM1
34.48217029604-Aug-2303-Aug-23CM1
14.7517030028-Nov-2324-Nov-23CM1
14.7517030226-Sep-2322-Sep-23CM1
14.7517030329-Aug-2325-Aug-23CM1
14.7217030428-Jul-2327-Jul-23CM1
14.7517030527-Jun-2323-Jun-23CM1
67.74817188018-Aug-2311-Aug-23CM2
130.441517188105-Oct-2321-Sep-23CM1
21.15217188328-Jul-2327-Jul-23CM1
40.65717188426-Sep-2320-Sep-23CM1
43.56417188530-Jun-2327-Jun-23CM4
91.161017188605-Oct-2326-Sep-23CM1
19.72217213903-Aug-2302-Aug-23CM4
19.72217214006-Jul-2305-Jul-23CM4
14.3417214310-Jul-2307-Jul-23CM4
1.8217245429-Jun-2328-Jun-23CM2
21.45217252419-Jul-2318-Jul-23CM1
24.84217262304-Jul-2303-Jul-23CM4
8.36217262713-Sep-2312-Sep-23CM4
8.36217262805-Jul-2304-Jul-23CM2
19.96217262914-Sep-2313-Sep-23CM4
19.96217263005-Jul-2304-Jul-23CM3
45.3417268114-Jul-2311-Jul-23CM3
4.39417268519-Jun-2316-Jun-23CM4
25.4617271104-Jul-2329-Jun-23CM3
22.95317271229-Jun-2327-Jun-23CM3
44.31717271321-Jun-2315-Jun-23CM2
3.55116695721-Jun-2321-Jun-23CM2
6.56017153316-May-2316-May-23CM1
4.48117208823-Jun-2323-Jun-23CM2
4.49116803229-Aug-2329-Aug-23CM1

 

Thanks in Advance.

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Thanks for the input but what i am missing was another step .Issue with above it will not show the exact divided hours by day. The solution that I found is I use List and I generate row using Power Query .This will generate row based on start and due date . 

     

    List.Select(List.Dates([JobOper_StartDate], Duration.Days([JobOper_DueDate] - [JobOper_StartDate]) + 1, #duration(1, 0, 0, 0)), each Date.DayOfWeek(_) >= 0 and Date.DayOfWeek(_) <= 4)

    (this list will also exclude weekend)

     

    And after that I just divided by hours and it will show by day, month and week.

     

8 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi some_bih , what i want to produce is the divided hours(calculated balancehours/days) based on the job start date and due date and able to plot into bar chart based on dates and resource

  • some_bih's avatar
    some_bih
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous ok, to be precise as much as possible, please provide sample output from your table above or you just need simple division for "calculated balancehours/days) "?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi some_bih,  My goal is to divide the calculate balance hours from job start date and due date ( i get the days from deducting from these dates) and plot a chart based on date. If i do a simple divide i would not get the divided hours on the days between start date and due date.

      • some_bih's avatar
        some_bih
        Icon for Community Champion rankCommunity Champion

        Anonymous  to provide some possible solution please provide expected output from your sample data.