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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Join is made on two table but related function is throwing error

Hello Guys,

I have established the joined between two tables based on commin field. but while taking related funtion ,it is showing error.

Can anyone please help me on this.

 

Error snapshot.

shankarshiva70_0-1620293856851.png

 

Connection.

shankarshiva70_1-1620293921965.png

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

As the error message mentioned, the context in your expression is ambiguous so that you cannot use it directly.

Note:

  • The RELATED function requires that a relationship exists between the current table and the table with related information. You specify the column that contains the data that you want, and the function follows an existing many-to-one relationship to fetch the value from the specified column in the related table. 

  • The RELATED function needs a row context; therefore, it can only be used in calculated column expression, where the current row context is unambiguous, or as a nested function in an expression that uses a table scanning function.A table scanning function, such as SUMX, gets the value of the current row value and then scans another table for instances of that value.

 

In this case, the relationship between two tables is many-to-many so you can create a bridge table to change it to many-to-one relationship. Please refer: Many-to-many to many-to-one 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

As the error message mentioned, the context in your expression is ambiguous so that you cannot use it directly.

Note:

  • The RELATED function requires that a relationship exists between the current table and the table with related information. You specify the column that contains the data that you want, and the function follows an existing many-to-one relationship to fetch the value from the specified column in the related table. 

  • The RELATED function needs a row context; therefore, it can only be used in calculated column expression, where the current row context is unambiguous, or as a nested function in an expression that uses a table scanning function.A table scanning function, such as SUMX, gets the value of the current row value and then scans another table for instances of that value.

 

In this case, the relationship between two tables is many-to-many so you can create a bridge table to change it to many-to-one relationship. Please refer: Many-to-many to many-to-one 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors