Skip to main content

Power BI

New

Allow compound keys in relationships

Vote (63) Share
's profile image

on 02 Feb 2016 14:39:51

Allow data modellers to define more complex relationships between tables. Currently, no compound key relationships are allowed, which hinders modelling and design, as now what should be a simple process becomes more complicated with users needing to manufacture unique non intelligent keys.

Comments (6)
's profile image Profile Picture

0e90dc54 f641-4a1d-a239-39147194eb42 on 06 Jul 2020 00:16:16

RE: Allow compound keys in relationships

The lack of this functionality is very disappointing. The workaround does not apply on all types of columns and disables DirectQuery mode.

's profile image Profile Picture

18d0e2fd 93a4-4112-ba48-0b1f8a2eba7e on 05 Jul 2020 23:51:14

RE: Allow compound keys in relationships

I support this - the lack of composite key support in the query editor infers that Microsoft demands a surrogate key, which is senseless. Modelling should be allowed to create the (minimum) required key to support the business intention, and the tool reading from the datastore needs to support this.
I've just hit this in an otherwise poorly modelled legacy store which I wanted to use PowerBI to give the business faster, more collaborative access to the data.
I will work around this gap by creating the join in a view. That is going to mean I need a deployment in order to create that view.

's profile image Profile Picture

4cad99e2 d4de-4b72-8651-1ed6eb722280 on 05 Jul 2020 23:17:32

RE: Allow compound keys in relationships

Absolutely agree.

's profile image Profile Picture

78c2713a 3328-43d7-a47c-22dffbedd25c on 05 Jul 2020 23:16:18

RE: Allow compound keys in relationships

The concatenation solution does not work in direct query mode. When there are large tables, it is not practical to use import mode. Please fix this.

's profile image Profile Picture

79830b0f 49ca-4b9e-a515-61f51162a0ee on 05 Jul 2020 22:55:47

RE: Allow compound keys in relationships

I totally agree - this is a competitive disadvantage in the Microsoft BI stack today. Creating artificial keys could introduce unintended problems, not to mention it's non-value-added time and extra data to haul around.

's profile image Profile Picture

4d11c5f9 4c08-4089-92c8-ce25231802d3 on 05 Jul 2020 22:44:38

RE: Allow compound keys in relationships

It'd be nice, but a simple alternative is to create another column on the dataset that concatenates fields to create a compound key.