Showing results for 
Search instead for 
Did you mean: 
Resolver I
Resolver I

PBI Performance when using string instead of numeric for relation keys

This question is derived from a former problem of mine. 

Due to rounding problems in PBI I was not able use a big numeric (16 digits) as a key to connect to other tables. (Solved: Re: Typecasting and Accuracy for index columns - Microsoft Power BI Community)


I've recently found out there there might be never a solution for it (Solved: Re: Unexpected long numbers round in Table visual - Microsoft Power BI Community)


I expect if I change the datatype to varchar/string instead of numeric that the quering performance will be much worse and the dataset is increasing a lot (2 Mio rows with 16 character keys instead of 16digit keys). What is your opinion on that? Is there a nicer way to overcome the initial problem without reducing performance and increasing dataset size?

Super User
Super User

There is no easy answer to this - you need to try it .  Keep in mind that the Vertipaq engine uses columnar compression, so the cardinality of your columns plays a bigger role than the size of the columns.

I see. I'll try. I can choose two use 20 character long key (comes from concat two strings) or to use the hashed value of they string. Is there any advantage in hashing it?  Assume both methods create a 20byte value. Is there any performance advantage one can expect using the hashed value?

Leave the hashing decision to the engine.

PBI doesn't make it easy... Hashing creates binary, so I need to convert that before to mmmh, I'd say only string is possible, since when changing it to numeric I end up in the same situation as before...


And if I convert it to string, that I don't need to hash it. Instead my string I hahsed is sufficient for it is unique already.

Helpful resources

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!