Forum Discussion
JWorthy
Advocate I
6 years agoFormatting Postcodes
Hello, I have a .csv of delivery information with postcodes that I need to format correctly before I import into Power BI. Below are the different incorrect ways that postcode information can...
- 6 years ago
Hi,
- Open Power Query editor.
- Select column 'Postal Code_Incorrect (how i receive them)'.
- Change data typ to text.
- Tab Add Column > Column From Examples
- Enter in the first row the postal code A9 9AA, press Enter.
- Enter in the second row the postal code A99 9AA, press Enter.
- Ok.
- Tab Transform > Format > UPPERCASE.
- Done!
Regards FrankAT
FrankAT
Community Champion
6 years agoHi,
- Open Power Query editor.
- Select column 'Postal Code_Incorrect (how i receive them)'.
- Change data typ to text.
- Tab Add Column > Column From Examples
- Enter in the first row the postal code A9 9AA, press Enter.
- Enter in the second row the postal code A99 9AA, press Enter.
- Ok.
- Tab Transform > Format > UPPERCASE.
- Done!
Regards FrankAT
- CerysWakeman3 years agoNew Member
Hi Frank,
Thank you for your example it was helpful. When I did this to my dataset the rule it created only created an if>then clause for all the postcodes containing errors.
This means I have to manually check when I append data. Is this because I had too few erroneous examples to work from? Would it be better to remove all spaces in the correct postcodes and then complete?If not do you know how I could create a more substantial rule? I think for my data a rule where there's a space before the last 3 characters would fix all errors.
Screenshot added with fictional values to illustrate.