Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to call a Function to generate multiple queries

I have a complex function that does a ton of modeling on some very wide and deep tables. To reduce the amount of data the function takes a single text argument that is used as a filter. At the end the function returns a table that is cleaned up as required.

 

I have another query that is the list of all possible filter values that could be applied to my initial function. Single column of text values where each row represents a possible filter value.

 

I'm stumbling over how to basically loop through that list of filter values and generate a table for each filter value. I'm not sure if I need to build an actual loop or if there is some way I can iterate through the list and generate the neccessary tables for each?

 

Thanks,

-Robert

1 ACCEPTED SOLUTION
otravers
Community Champion
Community Champion

The first list should be a one-column table, then invoke your function as a new column:

https://docs.microsoft.com/en-us/power-query/custom-function#invoke-a-custom-function-as-a-new-colum...

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

View solution in original post

2 REPLIES 2
otravers
Community Champion
Community Champion

The first list should be a one-column table, then invoke your function as a new column:

https://docs.microsoft.com/en-us/power-query/custom-function#invoke-a-custom-function-as-a-new-colum...

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals
Anonymous
Not applicable

Ugh, such a "duh" moment, answer was right in front of my face and I ignored it. Thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.