Forum Discussion

mshamsiev's avatar
mshamsiev
Helper I
9 years ago
Solved

Extracting Text from various places within a string

Hi all,   I have a column containing Priorities 1-4 in the format P1,P2 etc. which I'd like to isolate/extract.     However, within the column, the entire string appears in various forms as seen ...
  • MarcelBeug's avatar
    MarcelBeug
    9 years ago

    Yes, it is Power BI, more specifically Power Query, accessible via "Edit Queries".

     

    Even simplified further:

     

    let
        Source = Table1,
        #"Added Custom" = Table.AddColumn(Source, "Priority", (This) => List.SingleOrDefault(List.Select({"P1","P2", "P3", "P4"}, each Text.Contains(This[SLA Definition],_)),""))
    in
        #"Added Custom"