Sorry, I could not think of a better, fitting title. The text should clarify ...
In thefollowing scenario: 4 employees should work on different days. The table looks like this:
Date Name
12/13/2018 Carol, John
12/14/2021 Peter, Carol, John, Alice
12/15/2018 Alice
12/16/2018 Peter, Alice
12/17/2018 John, Peter
OK, split names at "," (with trailing space) and paste as lines; since there must be 3 columns: insert index column and then pivoting brings this result:
Index 12/13/2018 12/14/2018 12/15/2018 12/16/2018 12/17/2018
0 Carol null null null null
1 John null null null null
2 null Peter null null null
3 null Carol null null null
4 null John null null null
5 null Alice null null null
6 null null Alice null null
7 null null null Peter null
8 null null null Alice null
9 null null null null John
10 null null null null Peter
But what I want as a result:
Index 12/13/2018 12/14/2018 12/15/2018 12/16/2018 12/17/2018
0 Carol Peter Alice Peter John
1 John Carol null Alice Peter
2 null John null null null
3 null Alice null null null
I will delete the column index later. So I got to the desired goal: with the exception of the column index and the (correctly arranged) column 12/13/2018 create each additional column as a new query and filter / delete the null cells. Then delete the previous date column and re-insert the newly created date column into the query via merge.
This is very cumbersome and tedious in my opinion. Is there a better way in Power Query?
I would be glad, if you would describe a better way with simple words and if possible step by step (not only M-Code).