Forum Discussion
Specific formatting with DAX or M
- 4 years ago
Hi AlexisOlson
Thanks for letting me know, it makes sense now for me.
So MarcoFogale if you need DAX try this code to add a new calculated column:
New Format = Var _L = len('Table (2)'[article number]) Var _A = RIGHT('Table (2)'[article number],2) Var _B = RIGHT(left('Table (2)'[article number],if(_L-2<=0,0,_L-2)),2) Var _C = RIGHT(LEFT('Table (2)'[article number],if(_L-4<=0,0,_L-4)),3) Var _D = RIGHT(LEFT('Table (2)'[article number],if(_L-7<=0,0,_L-7)),4) Var _G = _D & "." & _C & "." & _B & "." & _A Var _H = if(left(_G,1)=".",right(_G,len(_G)-1),_G) return _Houtput:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
VahidDM ValtteriN, OP specified that the numbers come in integer form, which doesn't have an inherent dot formatting like that. I think they want to insert dots into a raw integer rather than remove them from a text string.
MarcoFogale Please correct me if I have misunderstood.
AlexisOlson that's correct.
For exemple:
input (whole number) -> 2411000012312
expected output (text) -> 2411.0000.123.12
I was wondering if instead of a complicated DAX formula there was a way to obtain that with custom formatting strings, for example ####.####.###.## something like this...
Thank you