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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
TeeGee
Helper II
Helper II

Possible to completely replace a table in a model with a newly devloped version of it?

I have an existing data table (built from loading a directory full of Excel files with fairly complicated transformations) that I would like to replace with a completely newly developed version (new table in the same model) - I'd rather not delete the first one as I'd have to redo all of my relationships and measures.  Is there a simple way of doing this? 

 

Theoretically I could maybe just go into the artifacts and overwrite all the M via the advanced editor, but even if this was possible, it seems that for the main object I want to place, the "Transform Sample File" object seems to have somehow become hidden (which is a big part of the reason I rewrote it from scratch).  It still seems to exist somewhere and continues to execute, but I have no idea how I would get it to reappear.  (But even if it did, I still want to overwrite that tab;e with this new and improved one).

3 REPLIES 3
jdbuchanan71
Super User
Super User

If you go into the query editor for your final table, right click > edit query

TransformEditQuery.jpg

You should see all the queries present in the .pbix file.  Do you have the transform queries listed there?

TransformQueryList.jpg

I agree that the way to do it is to modify the M code in your final table to use the new source.  If I were you I would add the new source to your model and get it to match the old table EXACTLY (data types, column names, etc) and remember Power Query is case sensitive so you want your column names to be the exact same.

Once you are satisfied you can go into the advanced editor for the new query and copy the code then replace the code for the old query.

That's the thing though, that object seems to have somehow become hidden, I'll show a screenshot:

 

2019-09-17 09_18_04-BDI - Power Query Editor.jpg

You may notice I've also managed to get inconsistent incremental numbering on some of the different objects within the same folder, perhaps due to messing with filenames thinking I'd make it more obvious what query they are associated with.

 

I have a feeling I might be screwed?

 

I don't think you are screwed.  If you can get a table from the new source that matches the old source you can swap in the M code in the advanced editor then delete all the helper queries added by PowerQuery.

The model only knows what comes out of PowerQuery.  As long as the updated output matches the original output the model won't know the difference.

Certainly save a copy of your .pbix to test on though then give it a try.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.