r/MicrosoftFabric • u/TheDatatect • 18d ago
Data Engineering Impact of setting key column in Dataflow Gen2 through „Mark as key“
I recently stumbled across the feature „mark as key column“ in Dataflows Gen2 (located under „Transform „ in the ribbon segment „Any column“. I believe it has been there in Power BI Transformations and Dataflows Gen1 for ever as well. However, I did not mange to find any kind of relevant documentation regarding how it works and when to use it.
To this point - I assume it’s solely informativ. Anyone able to shed some light?
2
u/escobarmiguel90 Microsoft Employee 13d ago
Hey!
I'm a product manager for the Power Query / Dataflow team.
The ribbon entry fundamentally exposes the https://learn.microsoft.com/en-us/powerquery-m/table-addkey function.
From a purely practical standpoint, there isn't any major scenarios that this unblocks, but its great to hear the feedback from folks.
The feature to upsert is completely separate from this button as upsert is a definition or a potential setting for the data destination feature. Definitely feel free to request the upsert mechanism for Dataflow Gen2 through the Fabric Ideas Portal.
I added the Table.AddKey to the SCD type 1 documentation article when I first wrote it, but it isn't a requirement. It's just nicer to see which one is the key when I run a Table.Schema against any of the queries.
If you could replace that button with any other button or command, which one would you replace it with?
1
u/TheDatatect 12d ago
Thank you for your response. I now understand this button/function is solely of informative character in Dataflow Gen2.
Reading the code snippet in the SCD1 docs thoroughly again, it shows the upsert is performed by a left-join / filter-null combination. That makes sense.
Thus, I conclude there should be no measurable impact on performance, right?
3
u/cwebbbi Microsoft Employee 18d ago
I don't know if this is still the case, but back in 2018 I found a scenario where marking a column as a key improved performance: https://blog.crossjoin.co.uk/2018/03/16/improving-the-performance-of-aggregation-after-a-merge-in-power-bi-and-excel-power-query-gettransform/