Forum Discussion

Josh_BI_UK's avatar
Josh_BI_UK
Helper II
7 years ago
Solved

Compare Two Tables - Repeat Rows in Table A for each Name in Table B

Hi PWR BI Family ❤,   I would like to create a report for managers, so that they can check which staff have missing timesheets.   I would like to know for every [WeekStart] in my WeekStartDatesTb...
  • HotChilli's avatar
    7 years ago

    I had a little play around with this.

    I created a new table

    AllWeeksAllStaff = CROSSJOIN(WeekStartDatesTbl, StaffNamesTbl)
    That gives you all the possible staff timesheets. You then have to link up with the existing
    timesheet table to find which rows don't have data.
    I created a unique key
    DateName = FORMAT('AllWeeksAllStaff'[WeekStart], "YYYYMMDD") & 'AllWeeksAllStaff'[Staff_FullName]
    and also a similar one in the existing timesheets table
    DateName = FORMAT(TimesheetsTbl[WeekCommencing],  "YYYYMMDD") & TimesheetsTbl[StaffMemberName]
    You then create a relationship between them, on this field.
    You can then construct a table visualisation with all the timesheet dates, staff, and
    timesheet ID. Missing ID's will show where there is no timesheet