The following steps show how to create a new column in a table using existing custom function code. This works in Power BI as well as in Power Query in Excel:
1. Copy the function code

2. Create new blank query in the query editor

3. Open the advanced editor

4. Replace existing function code by new one

5. Rename query (optional)

6. Invoke custom function

7. Edit function parameters

Enjoy & stay queryious
About the Author:
My name is Imke Feldmann and here I will share my ideas and concepts about utilizing Micrsoft’s cool new BI tools primarily in the Finance and Accounting area.
I’ve been working as a Finance Director, Head of Accounting and Controller for over 15 years. There I fell in love with Microsofts self service BI stack and decided to focus completely on bringing these tools to life. Now I’m providing BI training, consultancy services and developments mainly remote over the internet, living happily ever after…
Reference:
Feldmann, I. (2019). Screenshot tutorial: Add a column with custom function code in Power Query. Available at: https://www.thebiccountant.com/2019/01/30/add-a-column-with-custom-function-code-in-power-query/ [Accessed: 11th March 2019].