Just like in VBA where we can save functions macros in .xlam files and load them in another file. In power query I would like to store often-used functions in a central location and reference these locations when necessary.
I know that we can store power queries for later use by following this guide.
However, this tip does not work for functions.
Let's say I have a very simple function to get value of an Excel range:
(RangeName as text) =>
let
RangeValue = Excel.CurrentWorkbook(){[Name=RangeName]}[Content]{0} [Column1]
in
RangeValue
I have tried to link to this file as follows:
(RangeName as text) =>
let
GetFunction = Text.FromBinary(File.Contents(Excel.CurrentWorkbook(){[Name="PQMacrosFolder"]}[Content]{0}[Column1]&"RangeValue.txt")),
EvaluateFunction = Expression.Evaluate(GetFunction, #shared)
in
EvaluateFunction
(you see I am using the syntax of the function itself to get the folder path from the Excel named range "PQMacrosFolder".)
It shows the function is loaded into the Query Editor correctly.

But when I try to input some test values and invoke the function, it just shows the same function screen again.



