Forum Discussion
Leading Zero Issue
- Anonymous9 years ago
Quick solution is to create a new custom column in DAX with a formula:
FullZip = FORMAT([Zip], "00000")
Where [Zip] is your zip code field name.
Quick solution is to create a new custom column in DAX with a formula:
FullZip = FORMAT([Zip], "00000")
Where [Zip] is your zip code field name.
I am getting an Expression.Error: The name 'FORMAT' wasn't recognixed. Make sure it's spelled correctly.
- ACT8 years agoFrequent Visitor
I am too...I tried to write it within the Advanced Query Editor rather than creating a new column as well...tried to edit format changes, etc. Can't seem to get it to work. =(
- Ashish_Mathur8 years agoSuper User
Hi,
The solution offered by Ross is a DAX one (not an M one). If you wish to solve this problem in Power Query, please read here.
Hope this helps.
- ACT8 years agoFrequent Visitor
Ugh, thanks Ashish and Ross...however, it's not fixing my issue! I'm working with ID's, and some of them have 3-4 leading zeros...trailing zeros are not being deleted.
The original column is formatted as text...the calculated column seems to be referencing the correct table/column (as opposed to drawing from the incorrectly trimmed column)...what am I missing here? What else can I do?
- Anonymous8 years agoNot applicable
This is because its a DAX created column, not a Power Query formula.
EDIT: You beat me to it :P