Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Building from this thread: Solved: Pass Text String as Function Name - Microsoft Fabric Community
And having also reviewed Chris Webb's blog post as noted in the same thread.
I need to pass an arguement to the function, from a colum. So my set-up looks like this:
Geo | DataType |
US | projects |
US | users |
CA | projects |
CA | users |
so now I need to write an expression that looks like this:
#"ExecuteFunction" = Table.AddColumn(
Source,
"AdminData",
each Expression.Evaluate(
"FnAdminQuery"&[Geo]&"("&[DataType]&")",
#shared
)
The trouble of course is the inner referecnce to the 'DataType' column. I was able to create a combined Record that included the List of [DataType] with #shared (per CW's blog post) but of course I get an error because I'm attempting to pass a List to the Function Arguement that is looking for a Text String. I'm not sure how to pass the current row state to the inner function to get the correct index from the List, or perhaps a different approach?
CW's blog post only deals with static variables that are constant for the entire expression. If Reza Rad's blog post (referenced by CW) has more information, the current link returns a 500 error.
Solved! Go to Solution.
Hi,
use Function.Invoke
Function.Invoke(Expression.Evaluate("FnAdminQuery"&[Geo], #shared),{[DataType]})
Stéphane
Hi,
use Function.Invoke
Function.Invoke(Expression.Evaluate("FnAdminQuery"&[Geo], #shared),{[DataType]})
Stéphane
Thanks so much! That was much easier than I was expecting!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
8 | |
7 | |
5 | |
5 | |
5 |
User | Count |
---|---|
10 | |
8 | |
6 | |
6 | |
6 |