Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago
Solved

Generate a schedule table

In one of my data sources I have a payroll table. For each employee it has a row for each date that they worked. I'd like to build something for future booked work. I think I have all the components ...
  • OwenAuger's avatar
    10 years ago

    Hi there,

    Sounds like you want to create this as a DAX calculated table. Here's one way of doing it:

    (Note: I'm assuming no relationship between BookWork and DateTable - might change things slightly if there is a relationship.)

    WorkSchedule = 
    SUMMARIZE (
        GENERATE (
            BookedWork,
            CALCULATETABLE (
                VALUES ( DateTable[Week] ),
                DATESBETWEEN ( DateTable[Date], BookedWork[StartDate], BookedWork[EndDate] )
            )
        ),
        DateTable[Week],
        BookedWork[EmployeeID]
    )