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
Rasmusrock
Helper II
Helper II

Extract text after/before certain symbol

Hi all,

 

How can i extract the text from each side of a symbol in DAX?

 

I have tried to apply the following formula: =LEFT(B2;(FIND("/";B2;1)-1)) , which works in excel.

 

However, when i use the following formula: =LEFT([GRUPPE];(FIND("/";[GRUPPE];1)-1)) , in powerpivot, referencing the column that i want to look up, it returns the following error:

 

"The search Text provided to function 'FIND' could not be found in the given text"

 

What am i doing wrong?

 

Best regards

 

Rasmus Röck

1 ACCEPTED SOLUTION
PavelR
Solution Specialist
Solution Specialist

@Rasmusrock you have to use the fourth (conditional) parameter of the FIND function - it is used when the text which has to be found is not found - you have data where the "/" is not contained.

 

Then will your formula work.

 

Regards.

Pavel

View solution in original post

4 REPLIES 4
PavelR
Solution Specialist
Solution Specialist

@Rasmusrock you have to use the fourth (conditional) parameter of the FIND function - it is used when the text which has to be found is not found - you have data where the "/" is not contained.

 

Then will your formula work.

 

Regards.

Pavel

Hi @PavelR,

 

Thank you very much for your reply.

 

I think it solved the initial problem, however, i am stilling getting an error. The error i get now is:

"Calculation error in column 'Varegrupper'[]: Cannot convert value 'Outdoor Living/Flower pots' of type Text to type Integer."

 

For info, 'varegrupper' is the tab i am working in, and 'outdoor living/flower pots' is one of the text strings i am trying to dissolve so i have one column with the 'outdoor living' part and one with the 'flower pots' part.

 

Hope you can help,

 

/Rasmus

 

PavelR
Solution Specialist
Solution Specialist

@Rasmusrock

 

please show me syntax of your whole formula.

 

Pavel

hi @PavelR,

 

I fixed it using your advice, thank you very much 🙂

 

/Rasmus

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.