Forum Discussion
Splitting columns into multiple rows
- 2 years ago
To achive the desired result you can use index column: before appending datasets you create an index in each of them. After you append queries as new they will be listed one under another (so Dataset A and then Dataset B). However, because you index column, you can sort them in a desired way (once you're done, you can delete index column in the final dataset in case you don't need it anymore):
I also don't remember whether you start with 2 separate datasets or you have just one, which you first need to split. In attached pbix you'll find both option (when you select one of them, just delete the second)
Is it what you've been looking for? 🙂
Thanks for the reply.
This is the only option I have for 'Append as New'. When I do this, all it does is put the entire table underneath the other, not alternating rows like my expected output above.
What are the columns of "Orange" and "Pink" tables? Are column names the same? You need to have different column names to achieve the desired result.
Let's summarize once again how "Append" works: first it searches for columns with the same names in the input tables. If found, rows of those columns are appended one under another. In the case when column names are different (so append can't find same names), columns that don't exist in the first table are added to the second one (rows of the first table for that new columns remain empty).
Check pbix attached for further details.
Good luck with your project and have a great day 🙂
- Ry0092 years agoHelper II
Hi Sergii
Thanks for getting back to me. I think I may not have explained correctly. I have multiple rows of data, not just one. And when I append, rather than alternating rows, its putting the two separate tables under one another, hope that makes sense?
So just to recap this is an example of what I start with
Want to achieve this
But append only does this;
- Sergii242 years agoSuper User
To achive the desired result you can use index column: before appending datasets you create an index in each of them. After you append queries as new they will be listed one under another (so Dataset A and then Dataset B). However, because you index column, you can sort them in a desired way (once you're done, you can delete index column in the final dataset in case you don't need it anymore):
I also don't remember whether you start with 2 separate datasets or you have just one, which you first need to split. In attached pbix you'll find both option (when you select one of them, just delete the second)
Is it what you've been looking for? 🙂- Ry0092 years agoHelper II
Thank you so much Sergii!
This is what I was after (from single dataset) 🙂What I neglected to include the requirement that the primary id in column A needs to be represented in the row underneath it for the corresponding index.
After 30 mins of looking for a solution.....stupid me realised, just keep it in both tables so when it appends, it will be in both. 🙂Thank you so much!
- Ashish_Mathur2 years agoSuper User
Hi,
Share some data to work with and show the expected result very clearly. It is very difficult to understand your requirement from small images. Share data in a format that can be pasted in an MS Excel file.