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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.