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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
govi
Helper II
Helper II

Copy data from query to multiple tables in query editor

Hi,

 

I use four instances of a query (about 600.000 rows).

I need these four versions because I need to use different filtering to calculate different metrics.

So when I refresh the data the query runs 4 times, which takes al very long time....

 

Is there a solution for this?

Is it possible to copy the data from the query into a four tables in the query editor, so it will refresh only once?

 

Thank you!

govi

4 REPLIES 4
v-xicai
Community Support
Community Support

Hi @govi ,

 

If the data structures of these tables are the same , you might use Append feature to combine the these tables into one table, see more about how to append: Append vs. Merge in Power BI and Power Query . While before using append feature, you might add custom column to distinguish and identify the different tables , see setting like below.

Custom column_table.png

 

 

 

If the data structure is different between these tables , you may create calculated table like DAX below to get combine table.

 

For example:

New table 1= UNION(
SELECTCOLUMNS('Table1',"Name1",[Description],"Name2",[Amount]),
SELECTCOLUMNS('Table2',"Name1",[Description],"Name2",[Amount]),
SELECTCOLUMNS('Table3',"Name1",[Description],"Name2",[Amount]),
SELECTCOLUMNS('Table4',"Name1",[Description],"Name2",[Amount]))
 
New table 2= UNION(Table1,Table2,Table3,Table4)

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xicai,

Thank you.

 

But I think this it not what I need.

I have a query and I need 4 copies of that query, but I don't want those copies to have the initial query in them because I want only the first query to fetch data.

 

Thank you!

govi

amitchandak
Super User
Super User

You can create

New Table = Old table.

But if you need just for dates. Please refer you can have multiple joins and use them as per need

HR-Analytics-Active-Employee-Hire-and-Termination-trend

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners ,
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Hi @amitchandak,

"New Table = Old table" can be done in DAX indeed. But I need to modify the "New Table" in the Query Editor. So the copying has to be done in the Query Editor. Is this possible?

 

Thank you!

govi

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.