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.
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 below. I have attempted to use an if formula which has worked in extracting the 'P1' 'P2' format. However, how can I extract the 'Px' from the bottom format (TCS (SAP) etc.) THANKS!
SLA Definition
P4 - Incident
P2 - Incident
P1 - Incident
TCS (SAP) Resolve P4 SLA - Incident
etc.
Solved! Go to Solution.
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"
If the priority is always followed by a <blank>, this will work:
let Source = Table1, #"Added Custom" = Table.AddColumn(Source, "Priority", (This) => Text.Start(List.SingleOrDefault(List.Select({"P1 ","P2 ", "P3 ", "P4 "}, each Text.PositionOf(This[SLA Definition],_)>=0),""),2)) in #"Added Custom"
List.SingleOrDefault generates an error if >1 priority was found and it will return "" if no priority was found.
Edit: or even better:
let Source = Table1, #"Added Custom" = Table.AddColumn(Source, "Priority", (This) => Text.Start(List.SingleOrDefault(List.Select({"P1 ","P2 ", "P3 ", "P4 "}, each Text.Contains(This[SLA Definition],_)),""),2)) in #"Added Custom"
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"
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
98 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |