Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
So my primary key in my fact table is actually a number, but users want it to be padded with leading zeros. I understand that labeling that as text increases the size by a lot. Would it be better to make that field a number and then create a new column where its padded or is that redundant?
Solved! Go to Solution.
Hi @PowerBITestingG,
In fact, this should relate to your table data amounts. Adding an additional column will affect the performance. You can simply use the 'Text.Length' and 'Text.Repeat' functions to add zero before the string.
Column =
Table.AddColumn(
#"Previous Step",
"columnName",
each
Text.Repeat("0", 8 - Text.Length([ID]))
& Text.From([ID])
)
Text.Repeat - PowerQuery M | Microsoft Docs
Regards,
Xiaoxin Sheng
Hi @PowerBITestingG,
In fact, this should relate to your table data amounts. Adding an additional column will affect the performance. You can simply use the 'Text.Length' and 'Text.Repeat' functions to add zero before the string.
Column =
Table.AddColumn(
#"Previous Step",
"columnName",
each
Text.Repeat("0", 8 - Text.Length([ID]))
& Text.From([ID])
)
Text.Repeat - PowerQuery M | Microsoft Docs
Regards,
Xiaoxin Sheng
@PowerBITestingG That would be redundant and would increase the size more than just converting the primary field to text and adding the leading 0's.
User | Count |
---|---|
81 | |
76 | |
70 | |
69 | |
54 |
User | Count |
---|---|
104 | |
99 | |
92 | |
78 | |
69 |