Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |