Forum Discussion
Generate a schedule table
- 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] )
Anonymous as OwenAuger said you can see each step with => https://daxstudio.codeplex.com/
Here are the Steps copied from Dax Studio and sorted in Excel
Like GENERATE(), Dax Studio is another thing I haven't quite learned how to use yet. :P But thanks for the breakdown Sean. That helps.
I just kind of like talking through it conceptually so I can get a better mental model of what's going on when I want to use the same function for a completely different use case. I've generalized what for instance FILTER(ALL(... means well enough that I can always picture what it's doing in anyone's formula, but there are still a few of these table-returning functions that I can't quite imagine as well.
- Sean10 years agoCommunity Champion
Anonymous Yes I definetely like to do the same - take my time to break down and see all steps as well.
I was just looking for some info on GENERATE( ) and found this...
http://www.powerpivotpro.com/2012/09/gantt-reworked-with-addcolumns-filter-generate-and-summarize/
Have not had time to explore it yet - but thought you may want to see it too
There's also a Gantt Custom Visual (on my List)
https://app.powerbi.com/visuals/show/Gantt1448688115699
Anyway as always a great solution by OwenAuger