Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Jdiepen
Regular Visitor

Powerquery - Duplicate row values to other rows based on unique identifier

Hi ,

 

I have an issue in my dataset (table1) where i have a CandidateID and on one two per CandidateID i have a SessionID registered. For all the others rows with the the same CandidateID the SessionID is "(not set)". The result I need (table2) is that per CandidateID I replace the "(not set)" with the sessionID that you can find in that one row.

 

I am quite lost and have tried to solve it with indexing, groupby, unpivot etc., but can't quite get the result I want.

 

Hopefully you can help out.

Table1

Application ID - sessie scope;CANDIDATE_ID;CREATED_AT;PROPERTY;Kanaal ID;SESSION_ID
a0d070000004R6sAAE;a0907000009gETSAA2;23-nov-23;Talent&Pro;;1695304737
a0d070000004R51AAE;a090Y000006JWzXQAW;23-nov-23;Talent&Pro;;1695295675
a0d070000004R6sAAE;a0907000009gETSAA2;22-nov-23;Talent&Pro;;(not set)
a0d070000004R51AAE;a090Y000006JWzXQAW;21-nov-23;Talent&Pro;;(not set)
a0d070000004R51AAE;a090Y000006JWzXQAW;22-nov-23;Talent&Pro;;(not set)
a0d070000004R51AAE;a090Y000006JWzXQAW;21-sep-23;Talent&Pro;1824;(not set)
a0d070000004R51AAE;a090Y000006JWzXQAW;21-sep-23;Talent&Pro;1824;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9983;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9808;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9909;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9910;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9911;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9912;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9913;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9914;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9915;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9793;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9794;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9795;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9796;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9797;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9798;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9799;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9800;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9801;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9802;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9803;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9804;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9805;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9806;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9908;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9907;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9906;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9894;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9885;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9886;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9887;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9888;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9889;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9890;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9891;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9892;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9893;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9895;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9905;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9896;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9897;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9898;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9899;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9900;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9901;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9902;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9903;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9904;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9807;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9809;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9857;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9810;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9835;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9836;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9837;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9838;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9839;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9840;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9841;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9842;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9843;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9844;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9845;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9846;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9847;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9848;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9849;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9850;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9851;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9852;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9853;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9854;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9855;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9834;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9833;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9832;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9820;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9811;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9812;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9813;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9814;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9815;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9816;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9817;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9818;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9819;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9821;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9831;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9822;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9823;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9824;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9825;(not set)
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9826;(not set)

 

Table2

Application ID - sessie scope;CANDIDATE_ID;CREATED_AT;PROPERTY;Kanaal ID;SESSION_ID
a0d070000004R6sAAE;a0907000009gETSAA2;23-nov-23;Talent&Pro;;1695304737
a0d070000004R51AAE;a090Y000006JWzXQAW;23-nov-23;Talent&Pro;;1695295675
a0d070000004R6sAAE;a0907000009gETSAA2;22-nov-23;Talent&Pro;;1695304737
a0d070000004R51AAE;a090Y000006JWzXQAW;21-nov-23;Talent&Pro;;1695295675
a0d070000004R51AAE;a090Y000006JWzXQAW;22-nov-23;Talent&Pro;;1695295675
a0d070000004R51AAE;a090Y000006JWzXQAW;21-sep-23;Talent&Pro;1824;1695295675
a0d070000004R51AAE;a090Y000006JWzXQAW;21-sep-23;Talent&Pro;1824;1695295675
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9983;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9808;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9909;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9910;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9911;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9912;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9913;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9914;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9915;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9793;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9794;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9795;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9796;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9797;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9798;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9799;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9800;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9801;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9802;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9803;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9804;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9805;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9806;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9908;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9907;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9906;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9894;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9885;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9886;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9887;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9888;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9889;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9890;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9891;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9892;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9893;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9895;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9905;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9896;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9897;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9898;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9899;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9900;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9901;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9902;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9903;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9904;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9807;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9809;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9857;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9810;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9835;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9836;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9837;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9838;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9839;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9840;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9841;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9842;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9843;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9844;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9845;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9846;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9847;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9848;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9849;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9850;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9851;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9852;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9853;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9854;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9855;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9834;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9833;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9832;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9820;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9811;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9812;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9813;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9814;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9815;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9816;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9817;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9818;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9819;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9821;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9831;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9822;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9823;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9824;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9825;1695304737
a0d070000004R6sAAE;a0907000009gETSAA2;21-sep-23;Talent&Pro;9826;1695304737

 

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

Hello, @Jdiepen 

let
    Source = your_table,
    g = Table.Group(
        Source, "CANDIDATE_ID", 
        {{"rows", 
        (x) => 
            [a = Table.TransformColumns(x, {"SESSION_ID", (w) => if w = "(not set)" then null else w}),
            b = Table.Sort(a, {"SESSION_ID", Order.Descending}),
            c = Table.FillDown(b, {"SESSION_ID"})][c]
        }}
    ),
    expand = Table.ExpandTableColumn(g, "rows", List.RemoveItems(Table.ColumnNames(Source), {"CANDIDATE_ID"}))
in
    expand

View solution in original post

2 REPLIES 2
AlienSx
Super User
Super User

Hello, @Jdiepen 

let
    Source = your_table,
    g = Table.Group(
        Source, "CANDIDATE_ID", 
        {{"rows", 
        (x) => 
            [a = Table.TransformColumns(x, {"SESSION_ID", (w) => if w = "(not set)" then null else w}),
            b = Table.Sort(a, {"SESSION_ID", Order.Descending}),
            c = Table.FillDown(b, {"SESSION_ID"})][c]
        }}
    ),
    expand = Table.ExpandTableColumn(g, "rows", List.RemoveItems(Table.ColumnNames(Source), {"CANDIDATE_ID"}))
in
    expand

Hi @Ali ,

 

This is awesome, thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.