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
GillesDesbois
Regular Visitor

Select a variable part in another cell

hello
my question is :

I have a column with data like :

02009bat2555 - 3605054429035.pdf

3605052926581 nouveau logo.pdf

I need to extract only the 13 digits "360..." in a new column.
You can see that the 13 digits are never in the same place (I have an infinity of combination)

Do you think it's possible to have a function (or combination of functions) tio do this ?

thanks for your help

Gilles

1 ACCEPTED SOLUTION
Nathaniel_C
Super User
Super User

I used 5 for my count number, rather than 13.

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Nathaniel_C
Super User
Super User

I used 5 for my count number, rather than 13.

 





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

Proud to be a Super User!




Nathaniel_C
Super User
Super User

Hi @GillesDesbois ,

Yes it is possible. I used PowerQuery. I used Text.PositionOf, and Text.Middle.

See pic and Adv Editor. You could combine this into one column, but left it this way for ease of understanding.

 

Please let me know if you have any questions.

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

Extract text.PNGe

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjYzMDTVK0hJU9JRUlCK1YGImFlYAvlgromJqakZUMzUFCwSCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.PositionOf([Column1], "360")),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Text.Middle([Column1],[Custom],5))
in
    #"Added Custom1"

 





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

Proud to be a Super User!




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.