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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Chimichanga2024
Regular Visitor

how to dynamically load data to separate sheets? TIA

this is the mock data I used for reference

I have a set of monthly tasks for our department that I need to complete. After cleaning the data in a table(normally it is like 500-700 rows of data with like 50-80 locations, I need to load it into separate tabs based on location. For example, in the "San Diego, California" tab, I want the data to only include records related to San Diego, CA. Normally it should be like 50 to 80 tabs.

 

StaffUnit PriceQuantitylocation
A782San Diego, CA

 

Is there a way to automate this process in Power Query so that I don't have to manually duplicate and save a separate sheet for each location using the "Group By" function? I need a way to dynamically load data into the corresponding location tabs without doing it manually. Any advice will be appreciated!

 

3 REPLIES 3
PwerQueryKees
Super User
Super User

Do you really need separate tabs? Or could you put the data in a pivot table and add a slicer to select the location? Given the low number of records, there don't seem to be technical reasons to split...

Vijay_A_Verma
Super User
Super User

It will require a complete write-up to automate this workflow. While PQ supports many to one (like consolidation etc) but it doesn't support one to many. One query can't load into more than one sheet. You will need multiple queries. But one query also can't create multiple queries. 

You will need an Excel macro do the job which will split into many sheets after you load the result.

While, it will be a very long answer to integrate with Excel do which I will do some day, but for immediate relief, use the attached macro. You just need to select the column after populating your result or any cell in that column and run the macro and it will populate the respective sheets.

lbendlin
Super User
Super User

Is this for Excel?  Power Query does not support dynamic destinations.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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