To implement this recipe, do the following:
- Create the following two measures:
Hour Breakdown =
VAR __Hour = HOUR(MAX('R02_Hours'[Time]))
VAR __StartHour = HOUR(MIN('R02_Table'[Start]))
VAR __StartMinutes = MINUTE(MIN('R02_Table'[Start]))
VAR __EndHour = HOUR(MAX('R02_Table'[End]))
VAR __EndMinutes = MINUTE(MAX('R02_Table'[End]))
VAR __Table = GENERATESERIES(__StartHour,__EndHour,1)
VAR __Table1 = ADDCOLUMNS(__Table,"__minutes",
SWITCH(TRUE(),
__StartHour < __EndHour &&
[Value] <> __EndHour &&
[Value] <> __StartHour, 60 ,
__StartHour < __EndHour &&
[Value] = __EndHour, __EndMinutes ,
__StartHour < __EndHour &&
[Value] = __StartHour, 60 - __StartMinutes ,
__EndMinutes - __StartMinutes
)
)
VAR __Final = FILTER(__Table1,[__minutes]>0)
RETURN
SUMX(FILTER(__Final,[Value] = __Hour),[__minutes])
- Create a Matrix visualization and place the Date column from the R02_Table table into the Rows field for the Matrix visualization.
- Also, place the Time column from the R02_Hours table into the Rows field underneath the Date column from the R02_Table table to form an ad hoc hierarchy.
- Place the ID column from the R02_Table table into the Columns field for the Matrix visualization.
- Place the Hour Breakdown measure into the Values field for the Matrix visualization.
- In the Format pane for the Matrix visualization, expand Subtotals and turn off Row subtotals and Column subtotals.