Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ahansari_11
New Member

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

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @ahansari_11 ,

 

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:

 

Screenshot 2020-11-24 105612.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi  @ahansari_11 ,

 

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:

 

Screenshot 2020-11-24 105612.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Thanks, this was really helpful.

amitchandak
Super User
Super User

@ahansari_11 , Not very sure, try a new column like

 

new column = right([column], len([column])-3)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.