Forum Discussion
Duplicate rows in Power Query
- Anonymous3 years ago
Say you are at step name FullTable. Just filter to include only the accounts you want to duplicate, name this step Filtered, and then
= Table.Combine({FullTable, Filtered})
You can refer to any step in any order.
--Nate
- 3 years ago
Hi Power_BI_new,
I put together your example provided to show you how I achieved this differently than the other suggestions.So once I put together the data in an xlsx file, I started with the sample below. Please note that I had formatted the "Account Number" column as text.
So the first step was that I clicked the "Add Step" button to create a starting point and named the new step, "--original_data".
Then I used a filter on the "Account Number" column, using the text filter begins with a 6 or 7.
Then I appended the current query onto itself.
Then as the last step, when you select the append query step it will show the name of the query twice. So I changed one of those names to the "--original_data" step name, that I name in the first step.
from:
to:
This is my final result, which I believe matches what you are trying to acheive.
If I'm not coming accross clearly, happy to share the pbix file I put together if you have somewhere I can drop it π
If you need to, you can change the account number back to a whole number format.
Hi Power_BI_new,
I put together your example provided to show you how I achieved this differently than the other suggestions.
So once I put together the data in an xlsx file, I started with the sample below. Please note that I had formatted the "Account Number" column as text.
So the first step was that I clicked the "Add Step" button to create a starting point and named the new step, "--original_data".
Then I used a filter on the "Account Number" column, using the text filter begins with a 6 or 7.
Then I appended the current query onto itself.
Then as the last step, when you select the append query step it will show the name of the query twice. So I changed one of those names to the "--original_data" step name, that I name in the first step.
from:
to:
This is my final result, which I believe matches what you are trying to acheive.
If I'm not coming accross clearly, happy to share the pbix file I put together if you have somewhere I can drop it π
If you need to, you can change the account number back to a whole number format.
Thank you very much for this detailed answer!