Forum Discussion
Moving Calculated Columns/Measures to Replicated Snowflake Tables
- 5 years ago
Ideally this is what you do. 0% work will need to be done in Power BI, all in Power Query.
- Connect to Snowflake
- Transform the Snowflake connections in Power Query to mirror those of the SQL tables. This includes column renames as well as any other transformations.
- Open the Advanced editor for one of the snowflake tables and copy all of that M code.
- Open the Advanced editor for the SQL table you are replacing. Paste in all of that M code replacing the SQL M code.
- Close and apply.
Power BI Desktop will not know the difference. It will just work. Wash, rinse, repeat for every table.
In the tabular model, the table names aren't used. It really references table numbers, which is why you can easily rename tables with no harm. But it means you cannot create a new query in Power query with the same name and delete the old query and then import. They will have different underlying IDs.
Ideally this is what you do. 0% work will need to be done in Power BI, all in Power Query.
- Connect to Snowflake
- Transform the Snowflake connections in Power Query to mirror those of the SQL tables. This includes column renames as well as any other transformations.
- Open the Advanced editor for one of the snowflake tables and copy all of that M code.
- Open the Advanced editor for the SQL table you are replacing. Paste in all of that M code replacing the SQL M code.
- Close and apply.
Power BI Desktop will not know the difference. It will just work. Wash, rinse, repeat for every table.
In the tabular model, the table names aren't used. It really references table numbers, which is why you can easily rename tables with no harm. But it means you cannot create a new query in Power query with the same name and delete the old query and then import. They will have different underlying IDs.
- qbarnes5 years agoHelper I
edhans ,
Totally cool! This will be a huge time saver for me.
- I am experiecing other little bugs on close and apply, for two PBI Tables that were actually developed via SQL Queries. Here's the error prompt:
- Failed to save modifications to the server. Error returned; 'The column 'ExampleTable[ExampleColumn]' either doesn't exist or doesn't have a relationship to any table available in the current context. A circular dependency was detected: OtherTable[CalculatedColumn1], OtherTable[CalculatedColumn2], OtherTable[OtherTable[CalculatedColumn1].'.
So it appears my next hurdle will be to point all of my SQL Queirnes to the Snowflake Tables; I'm guessing.