There is a reason we turned off the row and column totals in the matrix. The reason is that, given the complex nature of this calculation, the totals end up being wrong. If the totals are needed, however, turn the row and column totals on and create the following measure:
Hour Breakdown Total =
VAR __Table = SUMMARIZE('R02_Table',[Date],[ID])
VAR __Table1 = GENERATE(__Table,'R02_Hours')
VAR __Table2 = ADDCOLUMNS(__Table1,"__Duration",[Hour Breakdown])
RETURN
IF(
HASONEVALUE('R02_Hours'[Time]) &&
HASONEVALUE('R02_Table'[ID]),
[Hour Breakdown],
SUMX(__Table2,[__Duration])
)
Place the Hour Breakdown Total measure into the matrix visualization created earlier in the recipe and note that both the individual rows as well as the row and column totals are correct while the row and column totals for the Hour Breakdown measure are incorrect.