Forum Discussion
power bi custom column syntax
- Anonymous5 years ago
Hi ryanb11 ,
Please check if the below screen shot is what you want? If yes, please update it in Power Query Editor.
1. Choose the related query and right click to choose "Rename" option, rename the query name as "rel"
2. Navigate to Home ribbon, click "Advanced Editor". Copy and paste the below codes into the opening window:
let Source = #table( {"Score"}, List.Zip( {{ "Call me on 08588812885", "Call me on 07525812845", "I need assitance please call me", "Last tried in 2019" }} ) ), #"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Split([Score], " ")), #"Added Custom1" = Table.AddColumn( #"Added Custom", "Custom.1", each Text.Combine( List.Select( [Custom], (l) => [ ListOfCharacters = Text.ToList(l), Result = not (List.Count(ListOfCharacters) >= 10 and List.AllTrue( List.Transform(ListOfCharacters, (x) => List.Contains({"0".."9"}, x)) ) )][Result] ), " ") ) in #"Added Custom1"Best Regards
Rena
I have told you the source table so whty are you unable to help me with the syntax?
I cannot send screenshots of sensitive data.
Please can you help with the syntax from the 'rel' table I have in power bi.
Hi ryanb11 ,
Please check if the below screen shot is what you want? If yes, please update it in Power Query Editor.
1. Choose the related query and right click to choose "Rename" option, rename the query name as "rel"
2. Navigate to Home ribbon, click "Advanced Editor". Copy and paste the below codes into the opening window:
let
Source = #table(
{"Score"},
List.Zip(
{{
"Call me on 08588812885",
"Call me on 07525812845",
"I need assitance please call me",
"Last tried in 2019"
}}
)
),
#"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Split([Score], " ")),
#"Added Custom1" = Table.AddColumn(
#"Added Custom",
"Custom.1",
each Text.Combine(
List.Select(
[Custom],
(l) => [
ListOfCharacters = Text.ToList(l),
Result = not (List.Count(ListOfCharacters) >= 10
and List.AllTrue(
List.Transform(ListOfCharacters, (x) => List.Contains({"0".."9"}, x))
)
)][Result]
), " ")
)
in
#"Added Custom1"Best Regards
Rena