Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi there,
is it possible to put a zero infront of the postcodes which are only 4 digits long?
Like the rowdata is 4758 but it should be 04758
Solved! Go to Solution.
In the Query Editor, I'd use Text.PadStart and add leading zeroes up to a length of 5 digits.
Indeed, the values must be of type text.
let Source = #table(type table[postcode = text],{{"4758"},{"123"}}), LeadingZeroes = Table.TransformColumns(Source, {{"postcode", each Text.PadStart(_,5,"0"), type text}}) in LeadingZeroes
You can find information on Power Query functions in Bemint - Power Query (M) Functions dashboard.
It should be, although I'd guess it'd need to be formatted as text if it isn't already. The approach I'd take is to make a calculated column that looks at the length of the current column (in DAX you'd use the LEN function, but I'd probably use Text.Length in M), and then if it's 4, concatenate a 0 in front otherwise retain the existing value
In the Query Editor, I'd use Text.PadStart and add leading zeroes up to a length of 5 digits.
Indeed, the values must be of type text.
let Source = #table(type table[postcode = text],{{"4758"},{"123"}}), LeadingZeroes = Table.TransformColumns(Source, {{"postcode", each Text.PadStart(_,5,"0"), type text}}) in LeadingZeroes
You can find information on Power Query functions in Bemint - Power Query (M) Functions dashboard.
User | Count |
---|---|
125 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |