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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
uzairsattar
New Member

Substring Text based on delimiter position defined in another column

Hi Guys,

 

I want to extract some text from a column based on the position of a delimter defined in another column.

Example of data

2020-10-23 23_44_44-Book1 - Excel.png

 

 

 

 

 

 

 

So i want all three Names column to be populated from values extracted from column FD.

Level columns define the position of delimter i.e. "_" after which the name exist for that particular column.

I would also like to handle the blank values the same way was mentioned in the table.

 

I am looking for a function in DAX to populate these column but incase you know how it's done in Power query that's also fine.

 

Any help in this regard will be highly appreciated.

 

Thanks,

 

Uzair

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

@uzairsattar ,

 

Check the attached file, the result it's different but I believe it can help you.

Capture.PNG



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

Proud to be a Super User!



View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

@Ashish_Mathur  Thanks for the help.

 

I am going with the @camargos88  solution. But that's neat trick you did with keyword.

camargos88
Community Champion
Community Champion

@uzairsattar ,

 

Check the attached file, the result it's different but I believe it can help you.

Capture.PNG



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

Proud to be a Super User!



@camargos88 Thanks.

 

It's funny that I just found the similar solution. I used the below code which apparently do the trick.

if [FruitLevel] <> null then ( Text.Split([FD], "_"){[FruitLevel]}) else null

The main problem is those levels columns are created using DAX Lookup, so I don't think I can use those columns with Power Query function.

 

Do you have any idea how can I achieve this ?

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.