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
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
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.