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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Brynut
Frequent Visitor

Extracted Text Before Delimiter using another column as the delimiter

Hi, Hopefully someone can help as I am a bit stumped...

 

I have two columns, one column contains the same data as the other but is concatenated with other data, I am trying to use 'Extracted Text Before Delimiter' to extract this but using a delimiter of the data from another column.

This is what I have so far....

 

let
Source = Salesforce.Data(),
KimbleOne__ResourcedActivity__c = Source{[Name="KimbleOne__ResourcedActivity__c"]}[Data],
#"Sorted Rows" = Table.Sort(KimbleOne__ResourcedActivity__c,{{"CreatedDate", Order.Descending}}),
#"Removed Other Columns" = Table.SelectColumns(#"Sorted Rows",{"Id", "Name", "KimbleOne__FullName__c"}),
#"Extracted Text Before Delimiter" = Table.TransformColumns(#"Removed Other Columns", {{"KimbleOne__FullName__c", each Text.BeforeDelimiter(_, {"Name"}), type text}})
in
#"Extracted Text Before Delimiter"

 

but I get a error in the 'KimbleOne__FullName__c' column for every row of "Expression.Error: We cannot convert a value of type List to type Text. Details: Value=List Type=Type".

 

Any ideas? I am new to Power Bi so apologies in advance if I have to ask any clarifying questions.

 

Thanks Simon

1 ACCEPTED SOLUTION


@Brynut wrote:

Hi, of course please see example below...

  • Column1  - CustomerNameResourceName  -  Data example...  MicrosoftJohn Smith
  • Column2  - ResourceName  -  Data example...  John Smith

With the above I need to extract the CustomerName by using column 2 as the delimiter, the customer name and resource name vary in length from row to row.


To do that I would just add a custom column with the following expression:

 

Text.Replace([CustomerNameResourceName],[ResourceName],"")

View solution in original post

4 REPLIES 4
d_gosbell
Super User
Super User

Can you please post some example data and the expected result to help illustrate your issue?

Hi, of course please see example below...

  • Column1  - CustomerNameResourceName  -  Data example...  MicrosoftJohn Smith
  • Column2  - ResourceName  -  Data example...  John Smith

With the above I need to extract the CustomerName by using column 2 as the delimiter, the customer name and resource name vary in length from row to row.

Thanks

Simon

Brynut
Frequent Visitor

Thank you for you quick response and answer which worked perfectly.


@Brynut wrote:

Hi, of course please see example below...

  • Column1  - CustomerNameResourceName  -  Data example...  MicrosoftJohn Smith
  • Column2  - ResourceName  -  Data example...  John Smith

With the above I need to extract the CustomerName by using column 2 as the delimiter, the customer name and resource name vary in length from row to row.


To do that I would just add a custom column with the following expression:

 

Text.Replace([CustomerNameResourceName],[ResourceName],"")

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.