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
Anonymous
Not applicable

Measure to Extract specific characters from a String

I have a field with below values. 

 

SABBANK\O45678

SABBANK\345670

INDBANK\234090

SBIBANK\098765

 

I need to create a measure to give the below values present after "\". I need only measure and not a calculated column becausre the source is a live Power BI dataset connectivity.

 

O45678

345670

234090

098765

 

Please help.

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@Anonymous I think:

Measure = 
  VAR __String = MAX('Table'[Column])
  VAR __Slash = SEARCH("\",__String)
RETURN
  MID(__String,__Slash+1,LEN(__String)-__Slash)


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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

VahidDM
Super User
Super User

@Anonymous 
Try this measure:

New Value = 
Var _NoCh = search("\",FIRSTNONBLANK('Table'[Value],""))
Var _TEXT = FIRSTNONBLANK('Table'[Value],"")
return
right(_TEXT,LEN(_TEXT)-_NoCh)

The output will be as below:

VahidDM_1-1629983309236.png

 

 

 

 

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

Appreciate your Kudos VahidDM_0-1629983272306.png !!

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

I have the following base column source (actions)

- The theme is in different positions of the text and can have from 5 to 100 characters but if it has a similarity the dates are inside delimiter "( " ")" sometimes it is stuck to the text and sometimes not

How can I solve it?

ACTIONSWHAT I WANT TO SEE
SO-AND-SO OF SUCH THE (12/02/2019) CONCRETE THE BREAD(12/02/2019)
SO-AND-SO THE I DO NOT FINISH (12/02/2023) (12/02/2023)
SO-AND-SO THE DID NOT FINISH THE NEXT DAY OF GRADUATION (12/02/2023) (12/02/2023)

THANK YOU

VahidDM
Super User
Super User

@Anonymous 
Try this measure:

New Value = 
Var _NoCh = search("\",FIRSTNONBLANK('Table'[Value],""))
Var _TEXT = FIRSTNONBLANK('Table'[Value],"")
return
right(_TEXT,LEN(_TEXT)-_NoCh)

The output will be as below:

VahidDM_1-1629983309236.png

 

 

 

 

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

Appreciate your Kudos VahidDM_0-1629983272306.png !!

Greg_Deckler
Super User
Super User

@Anonymous I think:

Measure = 
  VAR __String = MAX('Table'[Column])
  VAR __Slash = SEARCH("\",__String)
RETURN
  MID(__String,__Slash+1,LEN(__String)-__Slash)


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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.