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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors