Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi,
a while ago i wanted to have way of selecting whihc function to use within a formala; ie sum, or average;
i have 2 ways Expession.Evaluate and Function.Invoke; so ;
select = parameter list which is a list of 0,1
let
Source = #table(
type table [Item = text, Unit = number],
{{"a", 2}, {"b", 3}, {"c", 3}, {"a", 2}, {"c", 2}, {"b", 4}}
),
flist = {List.Sum, List.Average},
Custom1 = Table.Group(Source, {"Item"}, {{"N", each Function.Invoke(flist{select}, {[Unit]})}})
in
Custom1or
textselect = parameter list "a", "b"
let
Source = #table(
type table [Item = text, Unit = number],
{{"a", 2}, {"b", 3}, {"c", 3}, {"a", 2}, {"c", 2}, {"b", 4}}
),
Custom1 = Table.Group(
Source,
{"Item"},
{{"N", each Expression.Evaluate(textselect, [a = List.Sum, b = List.Average])([Unit])}}
)
in
Custom1
Just wondered if anyone had other ways of selectiing functions or making a type of slicer for pq ?
Richard.
Solved! Go to Solution.
Make textselect a parameter
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 5 | |
| 4 | |
| 3 |