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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

0

Dax Related does not work on direct query tables from different sources in measure

i have two tables, laborstandards from dev database and openorderwork from prod database directly related by a many to one relationship, both of them are direct query storage mode, and both come from different databases

they are linked in a one to many relationship with LaborStandards being the one side and OpenOrderWork being the many side

 

my measure is the below

PickHours = SUMX(OpenOrderWork,RELATED(LaborStandards[PickLineMinutes])*OpenOrderWork[AllocatedIncompletePickLines]/60)
 
the error message is below
The column 'LaborStandards[PickLineMinutes]' either doesn't exist or doesn't have a relationship to any table available in the current context.
 
this message is not correct as the tables are directly related by a one to many relationship
Status: Delivered
Comments
Anonymous
Not applicable

Hi @kritchie ,

 

If you get an error like this "The column either does not exist or is not related to any of the tables available in the current context." It usually means the supplied column name is incorrect or does not exist. Or you are trying to reference a column from one table to another, but there is no relationship between the two tables.

 

If you are sure that the table is related and the column names provided are correct, but the RELATED function is still not working as expected, you can check several things:

1. Make sure the current relationship is active.
2. Make sure that the current relationship is configured with the correct columns.
3. If the current relationship is a many-to-one relationship, you can try using the RELATED function in the Lookup table instead of in the Fact table.

 

For more information you can refer to:

Why RELATED DAX function is not working in Power BI? 

Solved - Using RELATED() 

 

Best Regards,

Community Support Team _ Caitlyn

 

 

 

 

kritchie
Regular Visitor

thanks for taking the time to respond, @Anonymous 

1. the relationship is active

2. the relationship is configured with the correct columns

3. the related function is in the lookup table and not the fact table

 

i do not have this issue when the two direct query tables are from the same database, this issue only occurs when i try to do this with two direct query tables from different databases

kritchie
Regular Visitor

Relationship.pngyou can see the column exists here and tables are related correctlyyou can see the column exists here and tables are related correctlymeasure says otherwisemeasure says otherwise

Anonymous
Not applicable

Hi @kritchie ,

 

According to your case, the issue only occurs when you try to do this with two direct query tables from different databases.

 

The RELATED function cannot be used to fetch a column across a limited relationship. It's by design.

 

A model relationship is limited when there's no guaranteed "one" side. It can be the case for two reasons:

  • The relationship uses a Many-to-many cardinality type (even if one or both columns contain unique values)
  • The relationship is cross source group (which can only ever be the case for Composite models).

 

The RELATED DAX function can't be used to retrieve the "one" side column values.

 

You can refer to the official docs:

Remark of RELATED 

Model relationships in Power BI Desktop - Limited relationships 

 

 

Best Regards,
Community Support Team _ Caitlyn