Forum Discussion

mvgust's avatar
mvgust
Helper III
5 years ago
Solved

Keep only Timecard records which contain specific code

I've got a table with multiple columns of timecard records for employees. Each timecard record has a unique ID.  As part of this table we have attendance codes such as regular work, overtime work, va...
  • HotChilli's avatar
    HotChilli
    5 years ago

    Thanks for the data.

     

    Here's a Power Query solution (I didn't know if you wanted DAX or M solution)

     

    In Power Query, duplicate the table.

    In the table copy, filter the Attendance Code column for 'UX' (using the column header dropdown)

    Remove all the columns except 'Timecard ID'.  Right-click the Timecard ID and 'Remove Duplicates' (if required).

    You now have a table with a single column of the Timecard IDs that have a UX record.

     

    Using Merge Queries, merge this table with the original table using Inner Join on TimeCard ID.  

    Delete the unwanted column.

    You now have a table with 4 rows.

     

    Good luck