Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
brunozanoelo
Post Patron
Post Patron

Compound key

Why i cant use Compound Key in the binding of the tables?

Case:
Company 1 Seller 5
Company 1 Seller 6

Company 2 Seller 5

Should o use one column like "First Pk"_"Second Pk"?

1_5
1_6
2_5

Thanks... waiting for a reply.

1 ACCEPTED SOLUTION
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @brunozanoelo ,

 

Compound keys are less essential in an Analytics/Reporting environment, but yes if you concatenate the values you can create relationships between tables.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @brunozanoelo ,

 

Compound keys are less essential in an Analytics/Reporting environment, but yes if you concatenate the values you can create relationships between tables.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Please be careful concatenating values to create compound keys, ideally convert id's to text and use a separator between them. This is a potential performance hit (text lookups are much slower than integer), but it is often necessary to avoid duplicate keys.

 

Consider:

Company 1 employee 12  key=112  

Company 11 employee 2  key=112

 

 

Anonymous
Not applicable

Hey @Phil_Seamark,

 

I think you need to do some clarification here. On what regards do you claim that compound keys are less essential? Why duplicate data which degrade performance??

Hi @Phil_Seamark! Thanks a lot!

Have a great day!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.