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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
v_mark
Helper V
Helper V

Extact text from multiple Delimiters

I know there is a way to do this in Power Query but I am just wondering if there is an option in DAX primarily in a calculated column. 

Currently my data looks like this . Thanks in advance!

 

CodeExpected result
BSA06 Test North - 19C19C
ASA01 Test-ABC - 32B32B
ESA05 NotReal – 1515
TSA01 Awesome Rural - ProvProv
3 REPLIES 3
Ahmedx
Super User
Super User

try to write like this

Text.Trim(Text.Range(
  [Code], 
  Text.PositionOfAny(
    [Code], 
    {Character.FromNumber(8211), Character.FromNumber(45)}, 
    RelativePosition.FromEnd
  )
    + 1
))

Screen Capture #662.pngScreen Capture #663.png

Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RhkhamWLt92LapWi6?e=vnoowN

 


 

Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

Column = mid(Data[Code],SEARCH(" - ",Data[Code],,0)+3,50)

It does not work for the third one, because that symbol is not a -.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ribisht17
Community Champion
Community Champion

@v_mark 

 

Please check this post and solution https://community.powerbi.com/t5/Desktop/Splitting-Text-on-multiple-delimiters-with-DAX/m-p/2480035

 

Regards,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.