Forum Discussion
Anonymous
5 years agoNot applicable
Repeat digits
Hi,
I wanted to create a column returning the last nth digits (should be dynamic, e.g 5 or 6 digits) if it has repeat digits.
if the Number is 24411111 results should 11111 or 87499999 results should be 99999.
Thanks
Hi Anonymous ,
Create a measure as below:
Measure = var _lastone=RIGHT(MAX('Table'[Number ]),1) var _search=SEARCH(_lastone,MAX('Table'[Number ]),1,0) Return RIGHT(MAX('Table'[Number ]),LEN(MAX('Table'[Number ]))-_search+1)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
3 Replies
- amitchandakSuper User
Anonymous , Not very sure, try a new column like
new column = right([column], len([column])-3)
- v-kelly-msftCommunity Support
Hi Anonymous ,
Create a measure as below:
Measure = var _lastone=RIGHT(MAX('Table'[Number ]),1) var _search=SEARCH(_lastone,MAX('Table'[Number ]),1,0) Return RIGHT(MAX('Table'[Number ]),LEN(MAX('Table'[Number ]))-_search+1)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
- AnonymousNot applicable
Thanks, this was really helpful.