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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.