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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
saranp780
Helper III
Helper III

Can anybody lets me know how to find some letters in Power BI?

I have some data a table below.

 

UsernameRoleMarkPlant
ADM1303Mangement1303x1303
PUR1303Procurement1303x13031401 
ADM1303ADMIN1303x1303
 ACT1403  
PUR1303Procurement1401x1303 1401
 Procurement1404 

 


If I got data from a user "PUR1303", the result would be 1303,1401.
I had a Plant no. at 4 digits number after "Role". Such as at row1 I had a username "ADM1303" with the roles "Managemen1303"[Plamt 1303] and ADMIN 1303" and I got "X" value at [Mark] so I want to get a plant no. from"Role". This result of the plant column would be 1303.

 

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

Hi saranp780,

 

You can use DAX formula below:

Measure = CONCATENATEX(DISTINCT(SELECTCOLUMNS(FILTER(ALL(Table1),[Mark]="x" && Table1[Username]=MAX('Table1'[Username])),"Plant",RIGHT([Role],4))),[Plant],",")

 Capture1.PNG

PBIX here: https://www.dropbox.com/s/7izzb5clb19z4hg/testsamle.pbix?dl=0

 

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi saranp780,

 

You can use DAX formula below:

Measure = CONCATENATEX(DISTINCT(SELECTCOLUMNS(FILTER(ALL(Table1),[Mark]="x" && Table1[Username]=MAX('Table1'[Username])),"Plant",RIGHT([Role],4))),[Plant],",")

 Capture1.PNG

PBIX here: https://www.dropbox.com/s/7izzb5clb19z4hg/testsamle.pbix?dl=0

 

Regards,

Jimmy Tao

Greg_Deckler
Community Champion
Community Champion

I'm not 100% sure of what you are asking but you could use the RIGHT function to grab the last four letters of a string like this:

 

Column = RIGHT([SomeColumn],4)

If you want it as an actual number, just wrap your RIGHT function in VALUE.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.