Forum Discussion
How do I create a custom function in column 2
- 6 years ago
Hi craig811
1. Create a blank query
2. Open the advanced editor, delete the code shown and paste this code instead:
(input_ as text)=> let list_ = Text.Split(input_,"."), output_ = Text.Start(list_{3},Text.Length(list_{3}) - 3) & list_{4} in output_3. Name the query with the name you want for the function, for instance myFunction_
4. In your original query, add acustom column with the code (assuming Column2 is where you have the data you want to apply the function to)
= myFunction_([Column2])Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs
Cheers
Hi craig811
1. Create a blank query
2. Open the advanced editor, delete the code shown and paste this code instead:
(input_ as text)=>
let
list_ = Text.Split(input_,"."),
output_ = Text.Start(list_{3},Text.Length(list_{3}) - 3) & list_{4}
in
output_
3. Name the query with the name you want for the function, for instance myFunction_
4. In your original query, add acustom column with the code (assuming Column2 is where you have the data you want to apply the function to)
= myFunction_([Column2])
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs
Cheers
- craig8116 years agoHelper III
This is great , how can I make the value show in all of the rows under my new column? Currently it will just show in one.
- AlB6 years agoCommunity Champion
What do you mean? are you just invoking the function with one value or are you creating a new custom column with the call to the function as I indicated earlier? I need more details/pics to understand what you mean
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers