In the quick tutorial video below, I have 2 CSV (comma-separated values) files with identical formats. I loaded the first CSV file into Power BI, opened the Power Query editor, and applied a bunch of transformations (not important what those steps are). Now, I want to apply the exact same steps to the second CSV file without having to do the steps manually by hand all over again. We’ll use Zillow‘s Inventory and Sales CSV datasets as an example.
The steps that you see in the Power Query user interface are actually Power Query’s M language code behind the scenes. Within the Power Query editor, the M code is accessible thru the Advanced Editor (under the Home ribbon) and can be copied to another table/query. The target table or query should have the same structure or similar structure, but the code may need to be tweaked. From the first CSV, copy the M code right after the line for step 1, because step 1 defines the data source. Then at the second CSV, paste and overwrite the M code right after the line for step 1. Once you close the Advanced Editor for the second CSV, you should see the same steps on the user interface. I hope that helps you out, please give me a Like over at my YouTube video to help others find this information.