Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'd like to know how managing better the surrogate keys for dimension tables with Power Query.
I've accomplish a proof.
I've imported MyFact and MyDimension tables. MyDimension table has B_key_dim as a primary key (the business key), MyFact table has B_key_dim as a foreign key for referring to MyDimension table.
For MyDimension table I've created an index column, S_key_dim (the surrogate key). Then, I've merged MyFact with MyDimension to implement an inner join and to get S_key_dim. Now, I'd like to delete B_key_dim colums in both MyFact and MyDimension, but I've an error when I delete B_key_dim column in MyDimension.
Any suggests to me, please? Thanks
Solved! Go to Solution.
Hi Yuliana,
by creating a copy of MyDimension table, having the index from the original table, to merge with MyFact table is possible to remove the business keys in both MyFact and MyDimension.
It should be useful to know if choosing an index as a surrogate key save memory respect to a business key like a GUID.
Thanks
Hi @Anonymous,
Did you get below error when you attempted to delete B_key_dim column?
As mentioned in error message, "The column 'B_Key_dim' wasn't found", that case, the new merged table is failed to be generated. Because the mapping key did not exist.
Based on my test, if you choose "Merge queries as new", you cannot delete the B_key_dim column in source two tables. But you can delete the repeated B_key_dim column in new merged table.
If you choose "Merge Queries" option, for example, you merge MyFact table to MyDimension table, at the last step, you could delete B_key_dim column in MyDimension.
Regards,
Yuliana Gu
Ok, but I'd like to delete B_key_dim colums in both MyFact and MyDimension, not only in one table.
Thanks
Hi @Anonymous,
I'm afraid this is not supported.
Regards,
Yuliana Gu
Hi Yuliana,
by creating a copy of MyDimension table, having the index from the original table, to merge with MyFact table is possible to remove the business keys in both MyFact and MyDimension.
It should be useful to know if choosing an index as a surrogate key save memory respect to a business key like a GUID.
Thanks
Hi @Anonymous,
Thanks for your sharing.
Regards,
Yuliana Gu
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |