cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Raul Member
Member

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

Accepted Solutions
WolfBiber Member
Member

Re: Table relations

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
vijay_kolisetty Frequent Visitor
Frequent Visitor

Re: Table relations

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

WolfBiber Member
Member

Re: Table relations

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

WolfBiber Member
Member

Re: Table relations

Or use this model approach:

Unbenannt.png

Raul Member
Member

Re: Table relations

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

 

Helpful resources

Announcements
Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors