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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sheetalshettiga
Helper IV
Helper IV

Relationships are removed on click of apply change with pbi file creation by automation

Hi all,

On unzipping a .pbix or .pbit file we get a DataModelSchema and Mashup file I trying to feed in the metadata frim json input to these files and zip back all the files and make it a .pbix or .pbit file.

But in DataModelSchema file I have given relation metadata information between columns from tables ORDER_ITEMS and ORDERS and the columns are ORDER_ID(ORDER_ITEMS) and ORDER_ID the column names are different but the values are same 

so Once I open a created .pbix it asks for apply changes and after clicking it relationships are disappeared.Before clicking apply changes if i see the data model view relationships are created as I have given in metadata file with required cardinality  from ORDERS to ORDER_ITEMS between columns ORDER_ID(ORDER_ITEMS) and ORDER_ID.

after apply changes will power bi not take the relations given in metadata or column name should be similar?or is power bi autodetecting relation based on similar columns

Please help

relation in metadata DataModelSchema file

"relationships": [
{
"name": "VP5UWUBR",
"fromTable": "ORDERS",
"fromColumn": "ORDER_ID",
"toTable": "ORDER_ITEMS",
"toColumn": "ORDER_ID (ORDER_ITEMS)",
"state": "ready",
"crossFilteringBehavior": "bothDirections",
"modifiedTime": "2020-07-09T12:26:18.966667",
"refreshedTime": "2020-07-09T12:27:59.303333",
"toCardinality": "many"
}
]

 

1 REPLY 1
Anonymous
Not applicable

HI @sheetalshettiga,

Have you turned the 'relationship detect' options on the power bi desktop which may change the current relationships?

Create and manage relationships in Power BI Desktop 

BTW, relationships are stored in a data model file, I don't think you can directly modify pbix file settings to quick generator/modify the relationships of data models tables. We do not recommend you to modify the internal files of pbix, these operations may break your report file and it is hard to be fixed.

Model relationships in Power BI Desktop 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.