Forum Discussion
Using Text.Length in an IF Statement
- 1 year ago
I am pretty sure the M Code you gave is not the actual M code giving the error, because ther is a syntax error in it. No closing ) for the Text.Length()
Please post (screenshots of) your data, some or all of the surrounding M Code and a screenshot of the error. By the look of it, the error might occur somewhere else...
I am pretty sure the M Code you gave is not the actual M code giving the error, because ther is a syntax error in it. No closing ) for the Text.Length()
Please post (screenshots of) your data, some or all of the surrounding M Code and a screenshot of the error. By the look of it, the error might occur somewhere else...
Thank you. The missing ) was my error when typing out the formula, the original did have the closing ). However I did go back to review the previous step and found that the Changed Type step removed the leading zeros of the Zip Codes. Once I removed the Changed Type step the formula was able to correctly populate.
- PwerQueryKees1 year agoSuper User
Glad you found the cause. The change type changed the ZIP from a text field into a number field and that caused your error. The removal of the zeroes is a side effect of that.
Did I answer your question? Then please (also) mark my post as a solution and make it easier to find for others having a similar problem.
Remember: You can mark multiple answers as a solution...
If I helped you, please click on the Thumbs Up to give Kudos.Kees Stolker
A big fan of Power Query and Excel