The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Good morning 🙂,
I have a database with steps applied to it on Power Query, I would like to add one last step to:
duplicate all the rows of my table whose "Account number" column begins with 6 or 7. I'll give you an example of what I want with a before and after:
Code | Category | Account number | Data |
1 | A | 600000 | E |
3 | B | 700000 | D |
3 | C | 100000 | C |
4 | E | 200000 | G |
Desired result :
Code | Category | Account number | Data |
1 | A | 600000 | E |
3 | B | 700000 | D |
3 | C | 100000 | C |
4 | E | 200000 | G |
1 | A | 600000 | E |
3 | B | 700000 | D |
Thank you for your help
Solved! Go to Solution.
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
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!
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
Thank you for your answer, but it gives me this error:
Sorry... We couldn't convert a value of type Table to type List:
Details :
Value = [ Table ]
Type = [ Type ]
Most likely you entered the code incorrectly, omitting the "{..}" around the List of tables
Works perfectly!!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
179 | |
52 | |
38 | |
25 | |
25 |