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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
jct999
Advocate II
Advocate II

Iterator over a table.

Hi,

I have a table with 4 columns and a few rows.

I want to iterate over this table and pass each row to a personal function. This personal function simply creates a table using the parameters (i.e, the values contained in the passed row).
Then, at the end, I want all tables created during iterations to be combined.

How can I do this iteration easily in M?

Regards

5 REPLIES 5
Anonymous
Not applicable

Hi @jct999 ,

Not very clearly....But it seems like you want to filter the table by parameter and then append all filtered table ,right?

Please take a look at the pbix file here.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best regards,

Eyelyn Qin

MFelix
Super User
Super User

Hi @jct999 ,

 

You need to create a custom function and then when you expand the final result you get the table you need.

 

Can you please share a mockup data or sample of your PBIX file and expected result. You can use a onedrive, google drive, we transfer or similar link to upload your files.



Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Thanks for your answer but it is not clear for me.


The table I want to iterate has 4 columns :
- FILE_NAME
- YEAR
- MONTH
- AUTHOR_ID


My personnal function just loads the file FILE_NAME in a table and add 3 columns to this table : YEAR, MONTH dans AUTHOD_ID.
Then, at the end, I want to combine all the table loaded in one table.


I can't send you my model nor PBix file... Could you show me an exemple.

Regards

 

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Thanks for your reply, but it is not clear to me.

The table I want to iterate has 4 columns:
- FILE_NAME
- Year
- MONTH
- AUTHOR_ID

My personal function just loads the FILE_NAME file into a table and add 3 columns to this table: YEAR, MONTH dans AUTHOD_ID.
Then at the end I want to merge all the loaded table into one table.

I can't send you my model or the PBix file ... Could you show me an example.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.