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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
powerbiexpert22
Impactful Individual
Impactful Individual

alphanumeric columns

is it okay to use below values (sample) for joining columns between two tables in power bi , these values are used to denote primary key of column, likewise we have such alphanumeric column values as primary key for other tables as well

 

BU_Key

--------------------------------------------
2146f4rr-18sf-q377-d11a-000s7g1165f1
1146j4mn-2fqw-w847-e14v-010k7b9g8

7 REPLIES 7
Anonymous
Not applicable

Your ideas is so great @rajendraongole1 

Hi, @powerbiexpert22 

Your use of such string columns as join keys does cause performance issues. For this reason, I created the following two tables to test its performance:

vjianpengmsft_0-1722481408549.png

vjianpengmsft_1-1722481419356.png

vjianpengmsft_2-1722481439914.png

The query performance for this state is as follows:

vjianpengmsft_3-1722481483887.png

My queries using numeric columns as join keys perform better:

vjianpengmsft_4-1722481540533.png

vjianpengmsft_5-1722481551520.png

vjianpengmsft_6-1722481568464.png

vjianpengmsft_7-1722481588390.png

There are performance gaps from small volumes of data, and if we create some metrics for these tables, the performance difference will be even greater. You can choose the right column as a join key depending on the situation you have.

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

Hi @Anonymous , is there a way to create  numeric primary key in power bi? can i use index function to create primary key

Anonymous
Not applicable

Hi, @powerbiexpert22 

You can use the DAX function to create an Index calculated column to be used as a primary key though. But when you use these two calculated columns to create a relationship between two tables, you are prone to circular dependency issues. Using my previous data as an example, I used the following two DAX expressions to create a calculated column in each of the two tables:

IndexColumn = RANKX(ALL(Customers), 'Customers'[CustomerID], , ASC, DENSE)

vjianpengmsft_0-1722489018397.png

IndexColumn = RANKX(ALL('Orders'), 'Orders'[CustomerID], , ASC, DENSE)

vjianpengmsft_1-1722489045721.png

vjianpengmsft_2-1722489568145.png

So, I would recommend creating the index column in the data source or in PowerQuery to ensure that there are no circular dependencies.

vjianpengmsft_5-1722490233078.png

 

In the future, if you have any new questions about creating primary key columns, you can post a new thread so that the rest of the community can help you in a timely manner.

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mickey64
Super User
Super User

Yes, you can use them.

The maximum number of characters you can use is 32,000.

 

Data types in Power BI Desktop - Power BI | Microsoft Learn

Hi @mickey64 

 

will there be any performance related concerns for using these text columns for joining, as per my understanding we should use numeric columns for better performance

Hi @powerbiexpert22  Adding to the performance , yes it is true when comparisons and joins on alphanumeric columns can be slower because string comparisons are generally more complex than numeric comparisons.Usually result in faster comparisons and joins due to simpler comparison operations as power bi use the columnar storage.

 

Hope it helps

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





I have no insight into performance.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.