Forum Discussion
PowerBI Desktop - duplicate a table including all DAX
- 2 years ago
In Power BI Desktop, duplicating a table along with its DAX columns and measures can be a bit tricky, as there is no direct built-in feature to do this. However, you can achieve this by creating a new table that references the original table's columns and measures. Here are the steps to duplicate a table with its DAX columns and measures:
Create a Duplicate Table:
You can create a duplicate table by going to the Power Query Editor. Follow these steps:
- Click on "Edit Queries" in the Home tab.
- Locate your table in the Power Query Editor.
- Right-click on the table you want to duplicate.
- Select "Duplicate."
This will create a copy of the table within the Power Query Editor.
Rename the Duplicate Table:
After duplicating the table, make sure to rename it to something unique. Right-click on the duplicate table and select "Rename."
Adjust DAX Columns and Measures:
To duplicate the DAX columns and measures associated with the original table, you will need to recreate them in the new duplicate table. You can copy the DAX formulas from the original table and paste them into the new table.
- Go to the Data view in Power BI Desktop.
- Click on the duplicate table to select it.
- In the Modeling tab, you can create new DAX columns and measures by entering the DAX formulas manually.
Export the Duplicate Table:
To export the duplicate table for use in other report projects, you can save the Power BI Desktop file or export it as a template:
- Save the current Power BI report.
- You can then share the .pbix file with others. When they open the file in their Power BI Desktop, they will have access to the duplicate table with its DAX columns and measures.
Please note that while this method allows you to duplicate the table and its DAX logic within the same report, exporting it for use in other report projects will require sharing the entire .pbix file, and users will need access to the same data source to make it functional.
Remember to update the DAX calculations in the duplicated table as needed, as they may reference specific columns or measures from the original table.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In the "modeling" tab, use "New table" and for the expression set the table to be equal to the table you want to copy. It's not in PQ, so it takes all your DAX calculated columns (but not measures since measures aren't truly part of the table).
it works and it is super easy. Thanks