This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi everyone,
I’m fairly new to Power Query and ran into an issue during data cleaning. After applying several steps, I realized that I need a column I had previously deleted earlier in the process.
I’d prefer not to redo all the subsequent steps just to recover that column. Is there a way to restore the deleted column without having to rebuild everything that comes after it?
Any tips or best practices would be really helpful. Thanks in advance
Hi @509fg
An interesting trick to pull out the required column after doing a lot of steps is using a few functions together.
Table.AddIndexColumn.
Table.TransformColumns.
Assuming you are pulling a column named "Sum" from Step2 which was deleted in Step3, while being in Step7 now.
At Step7, we can write this code which will directly pull out the column with no previous steps required.
= Table.TransformColumns ( Table.AddIndexColumn ( Step7 , "Index" , 0 , 1 ) , { "Index" , each Step2 [Sum] { _ } } )
What this code essentially will do is pick out the row position in Step2 as per our Index column created and populate the respective 'Sum" values in the new column.
A very important point to note: The RowCount in the previous step (Step2) that we are referring to extract the column should necessarily be the same rows as in the Step7.
Happy to connect and discuss more on this if this isn't clear on my part. Also, if a small reference file would be beneficial, please let me know.
Thanks,
Hi @509fg ,
We wanted to kindly follow up regarding your query. If you need any further assistance, please reach out.
Thank you.
Hi @509fg ,
Thanks for reaching out to Microsoft Fabric Community.
Just wanted to check if the responses provided were helpful. If further assistance is needed, please reach out.
Thank you.
In the Applied Steps pane on the right, click the step immediately before the "Removed Columns" step that deleted your column. This takes you back in time to when the column still existed.
@509fg you don´t need to rebuild "all the steps", just those steps where you removed, reordered or expanded tables.
Please try going back to the step where you deleted the column and ajust the script as needed:
for example, in this step i deleted "Col1" and "col2", if i dont want to erase one of those i just need to remove that column from the list.
if i need to have col2 back then the sentence would be:
= Table.RemoveColumns(#"Sorted Rows",{"Col1"})
If you deleted the column using "removeother columns", then just go to the setting of that step and adjust as needed:
Make sure that if you reordered the columns then you have to include the deleted column in the sorted list. And if you have other steps removing columns, you need to do the adjustment of the lists of columns removed or kept.
Hi,
To avoid repeating the process, i normally go to Advanced Editor and modify the M code manually
For example, you accidently removed ColumnB, find below step
= Table.RemoveColumns(Source, {"ColumnA", "ColumnB"})
Modify the code to
= Table.RemoveColumns(Source, {"ColumnA"})
Hi @509fg,
if I understand your question right, the following should help you:
You can remove each individual step by clicking the cross to the left of the step. Power Query will take care of the rest (cleaning up steps names, etc.).
But keep in mind that there is no undo for these kind of operations. I would recommend to save your report before you try to delete steps.
Does this help you?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |