Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello everybody,
I am currently trying to feed the List.Range function with parameters via a custom function, which sadly does not seem to be working.
The custom functions extract a value from the following spreadsheet table:
The custom function looks like this:
(ParameterName as text) =>
let
ParamSource = Excel.CurrentWorkbook(){[Name="tblParameter"]}[Content],
ParamRow = Table.SelectRows(ParamSource, each ([Parameter]=ParameterName)),
Value=
if Table.IsEmpty(ParamRow)=true
then null
else Record.Field(ParamRow{0},"Value")
in
Value
The custom function returns the correct result:
Yet when I insert the value returned by the custom function into the following formula, things go south:
= Table.SelectColumns(Source,List.Range(Table.ColumnNames(Source),0,14))
= Table.SelectColumns(Source,List.Range(Table.ColumnNames(Source),0,fnGetColumn("Submitted Forms: to Column")))
I am getting this error:
If I were to use a Power Query parameter, though, the List.Range function would accept it. But I need to extract the value from the spreadsheet.
Hope someone can help me out here!
Best regards!
This is what my Power Query privacy settings look like:
Where are the other privacy settings I am supposed to compare this with?
Where do I see the settings for the main datasource? Btw, the main source is a Files from Folder query.
Hi @Anonymous
Can this be the reference to a data files folder one line above the Excel workbook? Otherwise, you may be able to find it in the Global list (switch at the top of the Dialog window).
Kind regards,
JB
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 |