cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Phogon
Helper II
Helper II

Relationship + Metadata + Query + Update

I have the following datamodel (inactive relationships are intentional)

image.png

 

 

 

 

 

 

 

 

 

 

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.

 

Sid

3 REPLIES 3
parry2k
Super User
Super User

@Phogon 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?






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.





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?


Regards

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

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.