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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors