Forum Discussion
darylmc
6 years agoFrequent Visitor
Excel TEXT function - equivalent in DAX
Hi All,
I'm looking to replicate =TEXT(A2,"0000") in DAX in order to make sure a string column has at least 4 characters. What is the function to achieve this?
Thanks in advance
Use M, in transform data mode
4 Replies
- MFelixSuper User
- AnonymousNot applicableWe have len function to check the length of string.
New column=if(len(table[oldcolumn])<4,blank(),table[oldcolumn])
Or you can do this in power query as well
= if Text.Length([Projekt_ID]) <4 then "" else [project_id] - AnonymousNot applicableUse the FORMAT function.
Best
D - amitchandakSuper User
Use M, in transform data mode