Forum Discussion

EtienneB1's avatar
EtienneB1
Regular Visitor
6 years ago
Solved

Distribute work hours

Hello, I need to forecast work hours distributing the hour through the duration day. I will use an example to be more clear. I want to know how many hours per day I will need to work.  How I cr...
  • Icey's avatar
    6 years ago

    Hi EtienneB1 ,

     

    How about create a calculated table like so:

    Crossjoin Table =
    SUMMARIZE (
        FILTER (
            ADDCOLUMNS (
                CROSSJOIN ( CALENDARAUTO (), 'Table 1', 'Table 2' ),
                "enddate", [Start Date]
                    + CALCULATE (
                        SUM ( 'Table 2'[Duration(days)] ) - 1,
                        FILTER (
                            ALL ( 'Table 2' ),
                            'Table 2'[Process Name] <= EARLIER ( 'Table 2'[Process Name] )
                        )
                    ),
                "Hours", [Qty] * [Time per Unit(hours)] / [Duration(days)]
            ),
            VAR StartDate_ = [enddate] - [Duration(days)] + 1
            RETURN
                [Date] <= [enddate]
                && [Date] >= StartDate_
        ),
        [Date],
        [Id],
        [Process Name],
        [Hours]
    )
    

     

    For more details, please check the attached .pbix file.

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.