Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I am having issue to pass on columns as parameter for a function callback
Non function version
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTJSitWJBpI6SsZgljGQZaIUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [colA = _t, colB = _t]),
ct = Table.TransformColumnTypes(Source,{{"colA", Int64.Type}, {"colB", Int64.Type}}),
filter = Table.SelectRows(ct, (_)=> (Number.IsEven([colB]) = true))
in
filter
Function
let fn = (tbl as table, filterCol as record) as table =>
let
filter = Table.SelectRows(tbl, (_)=> (Number.IsEven(filterCol) = true))
in
filter in fn
fails on
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTJSitWJBpI6SsZgljGQZaIUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [colA = _t, colB = _t]),
ct = Table.TransformColumnTypes(Source,{{"colA", Int64.Type}, {"colB", Int64.Type}}),
filter = fx(ct, [colB])
in
filter
Thank you in advance
Solved! Go to Solution.
I think this is what you are intending to do.
let
Source = Table.FromRows({{1,2},{2,3},{3,4}}, type table[colA = Int64.Type, colB = Int64.Type]),
fx = (tbl as table, filterCol as text) as table =>
Table.SelectRows(tbl, (_) => Number.IsEven(Record.Field(_, filterCol))),
filter = fx(Source, "colB")
in
filter
I think this is what you are intending to do.
let
Source = Table.FromRows({{1,2},{2,3},{3,4}}, type table[colA = Int64.Type, colB = Int64.Type]),
fx = (tbl as table, filterCol as text) as table =>
Table.SelectRows(tbl, (_) => Number.IsEven(Record.Field(_, filterCol))),
filter = fx(Source, "colB")
in
filter
Thanks @AlexisOlson. This is awesome.
You saved me a lot of time, chat gpt failed too.
filtercol as record is the problem. try changing to any.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 10 | |
| 9 | |
| 6 | |
| 5 | |
| 3 |