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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Not applicable

Relationship + Metadata + Query + Update

I have the following datamodel (inactive relationships are intentional)












I am trying to make it so the file is a template, and the Data table can be ammended in the Query however I like with all sorts of random data. However, when I update the source perform cleaning, the relationship for Dim_001,002,003 gets deleted, whilst the relationships for calendar and attribute continue to exist.


I have done some testing, and believe it to be due to the metadata somewhat. If the raw data column has the exact same is the old and new file when I promote headers, then the relationship will maintain. In this situation, the calendar relationship with Data[Date_001] and Calendar[Date] remained as the raw data were both named "orderdate" initially. 


The attribute relationship naturally dont not refresh as it comes from the unpivoting of various financial lines. 


However, the point of this template is that I can throw random datasets of dimensions into my analysis. For example, my current analysis Dim_001 is productID. I tried to replace it with another dataset where the column header (after header promotion) was intially product_ID. When I updated the query, the relationship was deleted. 


However, when I changed the raw data to "productID", then the relationship would prevail after updating. 


My question is how do relationships work after updating queries, and is there a way to make it so that as long as the final name is the same in the old query and updated query, for the relationship to prevail and not be deleted. 


Please let me know if extra information is required.



Super User
Super User

@Anonymous I would expect the relationship to prevail if column name is the same for the updated query which seems like not working for you, correct?


Is the data source changing? Like changed from CSV to SQL or vice versa?

Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤

Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Not applicable

The data type is exactly the same. Its very very strange. 


Basically the issue now is that if the raw data name after "promote to header"step is different, then the newly updated information will break the relationship. 


Would it be helpful if I uploaded my DAX file?


This comment right here. THANK you!

“Basically the issue now is that if the raw data name after "promote to header" step is different, then the newly updated information will break the relationship.”


I don't know if this is a bug or by design but I was going nuts having lost a ton of relationships when patching some data from Excel. 


Open Excel, rename column THERE, refresh preview, relationships persist.


I don't know why, but this worked. Thanks for leaving the breadcrumb.


Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.


Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors