Forum Discussion

RichOB's avatar
RichOB
Post Partisan
10 months ago
Solved

Adding new columns from data

Hi, I have a data table that tracks employees who have left my company and then returned. I need the Date data when they have returned on the same row, as their singular NI_Number, please. How can I transform Table 1 into Table 2, adding the three new columns at the end?

 

Table 1 

NI_NumberNameTitleDate_JoinedDate_LeftDays_Employed
NI112233Dave JonesCustomer Service01/04/202420/05/202449
NI112233Dave JonesCustomer Service01/06/202410/06/20249
NI884455Eric DaviesCustomer Service01/07/202410/10/2024101
NI884455Eric DaviesCustomer Service20/10/202428/10/20248
NI009900Lloyd Williams Store Manager01/04/202410/09/202490
NI009900Lloyd Williams Store Manager01/10/202411/11/202441
NI887711Ian IansStore Manager10/05/202410/10/2024153
NI887711Ian IansStore Manager01/11/2024 327


Table 2 

NI_NumberNameTitleDate_JoinedDate_LeftDays_EmployedDate_Employed2Date_Left2Days_Employed2
NI112233Dave JonesCustomer Service01/04/202420/05/20244901/06/202410/06/20249
NI884455Eric DaviesCustomer Service01/07/202410/10/202410120/10/202428/10/20248
NI009900Lloyd Williams Store Manager01/04/202410/09/20249001/10/202411/11/202441
NI887711Ian IansStore Manager10/05/202410/10/202415301/11/2024 327

4 Replies

  • OktayPamuk80's avatar
    OktayPamuk80
    Responsive Resident

    Hi,

    I would create an index per Ni_Number (e.g. Solved: Index column based on value/category - Microsoft Fabric Community). With this index you can then create a matrix, where the index is your column, therefore in case of three entries per Ni-Number you would see 3 columns (or 9 due to three measures joined. left and employed).

    Regards,

    Oktay

     

    If it helped you would appreciate a KUDOS and mark the answer as solution.

  • v-aatheeque's avatar
    v-aatheeque
    Community Support

    Hi RichOB 

    We’d like to confirm whether your query has been addressed. If you still need help, please let us know and we’ll provide further guidance.

     

    • v-aatheeque's avatar
      v-aatheeque
      Community Support

      Hi RichOB 

      Have you had a chance to look at the earlier response? Let us know if anything is unclear, and we’ll provide further clarification.

      • v-aatheeque's avatar
        v-aatheeque
        Community Support

        Hi RichOB 
        We wanted to follow up to check if you’ve had an opportunity to review the previous responses. If you require further assistance, please don’t hesitate to let us know