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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

RIGHT, SEARCH, LEN only providing partial string outputs

Good day, 

 

I've searched the forums and the web and I'm hitting a wall with something which seems so straight forward, or I'm missing something.

 

The image below contains the DAX formula, the original "Text" and current "Output":

 

 

Output = RIGHT('Table'[Text], SEARCH(": ",'Table'[Text],1,LEN('Table'[Text])))

 

 

Image-01.png

 

Desired outcome: I have a large data set with variable string lengths to the left of the "Text" column, which is luckily always separated by a ":" and in some of the column rows, there might be text with no pre-text separated by a delimiter, so then it should just output the entire string (as per the "correct" outputs above). 

 

Any help or suggestions to achieve my desired outcomes would be greatly appreciated. 

 

Thanks!

1 ACCEPTED SOLUTION

@Anonymous 

please try this

Column = 
if(SEARCH(":",'Table'[TEXT],1,0)=0,'Table'[TEXT],right('Table'[TEXT],len('Table'[TEXT])-SEARCH(":",'Table'[TEXT],1)))

1.PNG





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

Proud to be a Super User!




View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , In case you are trying to split by delimiter, better do it in Power Query, refer 

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
ryan_mayu
Super User
Super User

@Anonymous 

please try this

Column = right('Table'[TEXT],len('Table'[TEXT])-SEARCH(":",'Table'[TEXT],1))

1.PNG





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

Proud to be a Super User!




Anonymous
Not applicable

Hi @ryan_mayu

 

Thanks for your prompt response, your proposal works, BUT only if a delimiter is present in the column. As soon as there is no delimiter present, I receive the following error message: 

 

The search Text provided to function 'SEARCH' could not be found in the given text.

 

As part of my OP, there will be rows without text being separated by a delimiter, but I would then just want it to display in the column, as per the "Correct" elements in the image of my OP. A combination of both what is needed for a solution. 

 

@amitchandak, as mentioned above, simply separating by delimiter does not solve the issue as it struggles to handle the aforementioned. 

 

Any suggestions?

Anonymous
Not applicable

Just for clarification, below is a sample of the desired output:

 

sample-output.jpg

@Anonymous 

please try this

Column = 
if(SEARCH(":",'Table'[TEXT],1,0)=0,'Table'[TEXT],right('Table'[TEXT],len('Table'[TEXT])-SEARCH(":",'Table'[TEXT],1)))

1.PNG





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

Proud to be a Super User!




Anonymous
Not applicable

That did the trick - thanks for your prompt responses @ryan_mayu !

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Solution Authors