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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
graemejohnson
Helper II
Helper II

Get last value from an delimited set of values

I have a column in a table which contains zero, one or more delimited values.  I want to extract value on the right hand side of the last delimiter if there is a delimer...for example the values highlighted in yellow below....

 

This is tying me up in knots trying to crack it Smiley Frustrated - please can someone help?

 

2019-08-01_17h05_27.png

1 ACCEPTED SOLUTION

Well, having had a further sniff around....I saw the 'Extract' option - and used that functionality to grab the last value 

Also then had to change the data type to a Whole Number

Seems a neat solution

 

2019-08-02_09h06_59.png2019-08-02_09h27_21.png

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

This type of thing is much easier in Power Query in my view. Assuming that's an option:

 

1.  Add a custom column that will give you  the position of the last delimiter

Text.PositionOfAny([Column1],{","}, Occurrence.Last)

Custom Col Last Occurrance.png

 

2. Custom column to get the text lenght of Column 1

Text.Length([Column1])

3. Final custom column to get the value of the last delimited value

if
[Position of Last Delimiter] < 0
then 
[Column1]
else Text.End([Column1],([Text Length]-[Position of Last Delimiter]-1)
)

Basically it's saying that is the position of last delimiter is negative (which means there is no delimiter) then give the value in that row. Else, start at the end of values in the current row, and go back to you find the first delimiter (which would be the last delimiter) 

 

Final Table:

Final Table.png

 

You could easily combine #1 and #2 into one step, but left them on here to show the idea. 

Well, having had a further sniff around....I saw the 'Extract' option - and used that functionality to grab the last value 

Also then had to change the data type to a Whole Number

Seems a neat solution

 

2019-08-02_09h06_59.png2019-08-02_09h27_21.png

Anonymous
Not applicable

Use Power Query for this. Not DAX. DAX is a data analysis language, not data manipulation language. M is.

Best
Darek

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.