Forum Discussion
Zip Codes - select
- 3 years ago
Peter32 you can add a column in PQ using following code:
if Text.Length([ZipColumn])>4 then null else [ZipColumn]👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️
Peter32 add a new column using Power Query or DAX, Power Query is preferred.
Here is DAX:
New Code = LEFT ( YourTable[ZipColumn], 4 )
Here is M code for PQ:
Text.Start([ZipColumn],4)
👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️
Thank you for your proposed solution, but unfortunately this doesn't work for me.
I have foreign postal codes with more than 4 digits and domestic postal codes with 4 digits. In your proposal I make all postal codes 4 digits. I just want to exclude postal codes of more than 4 digits so that only the domestic 4-digit postal codes remain.