The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello,
In power query I have a table with 2 columns that looks like this:
Tasks | SubTask |
Task1 | SubTask1.1 |
SubTask1.2 | |
Subtask1.3 | |
Task2 | Subtask2.1 |
Subtask2.2 | |
Task3 | Subtask3.1 |
In power query I would like to combine these into a single column with subtask showing up under the part task similar to this:
Task1 |
SubTask1.1 |
SubTask1.2 |
Subtask1.3 |
Task2 |
Subtask2.1 |
Subtask2.2 |
Task3 |
Subtask3.1 |
However, I am struggling with the steps involved. Please help. TIA
Solved! Go to Solution.
This is your source in PQ:
Select both columns, right-click and unpivot columns:
Remove the Attribute column, done.
Andreas.
This is your source in PQ:
Select both columns, right-click and unpivot columns:
Remove the Attribute column, done.
Andreas.
Awesome! This did it! Mistake I was making was only unpivoting one column.
@palvarez83 Honestly, that seems like a really bad idea. I would use Fill Down in your Tasks column instead. Can you explain why you want to do what you want to do because you almost certainly don't want it in that format. I mean, there may be a good reason but I can't think of what it might be.
The reason for doing this is for importing the tasks and sub tasks into MS project and that is the format required.
The tasks and sub tasks were pulled with copilot from a slide deck of multiple pages in which the slide title was the the Task name and the sub tasks were pulled were bullet points in the slide. The result was a table formatted like I've indicated above.
Since the solution above (unpivoting both columns) worked, I'm going to see if Copilot can do this directly (now that I know what to ask).