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
Raul
Post Patron
Post Patron

Table relations

Hello and Happy new year!!

I have this data model in my Power BI Desktop file:

Model.JPG

The dot line is a inactive relation between this tables because I can't relate them directly (it's show an error message that it would generate ambiguity between the tables Custormers and HistoricalInvoicesLines). How can I relate this tables? I need to know for a Record[CodRecord] which are the SUM(HistoricalInvoicesLines[Amount]) for this record.

Thank you!

1 ACCEPTED SOLUTION
WolfBiber
Microsoft Employee
Microsoft Employee

Hey,

you should use

USERELATIONSHIP(<columnName1>,<columnName2>)  

It explicit uses a relationship for calculating a measure.

 

https://msdn.microsoft.com/en-us/library/hh230952.aspx

 

https://www.sqlbi.com/articles/userelationship-in-calculated-columns/

 

Greetings.

 

View solution in original post

4 REPLIES 4
WolfBiber
Microsoft Employee
Microsoft Employee

Or use this model approach:

Unbenannt.png

WolfBiber
Microsoft Employee
Microsoft Employee

Hey,

you should use

USERELATIONSHIP(<columnName1>,<columnName2>)  

It explicit uses a relationship for calculating a measure.

 

https://msdn.microsoft.com/en-us/library/hh230952.aspx

 

https://www.sqlbi.com/articles/userelationship-in-calculated-columns/

 

Greetings.

 

Great!!! Thank you very much, the USERELATIONSHIP function is the solution.

 

vijay_kolisetty
Frequent Visitor

Hi

 

In this case you have check the data inside this entities or you can create one more entity by having distinct records and link it with Historical.

 

Regards,

V

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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