cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Unable to create a column based on relationship with another table

Hi,

 

I have a table (Table_A) with multiple values of a field (Field_A). There is anothe table (Distinct_Table_B) with only one field (Field_B). There is a one to many relation built from Field_B to Field_A.

 

I want to create a calculated column in Table_A which says 'True' if it finds matching Field_B for Field_A. 

 

Help requested.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Unable to create a column based on relationship with another table

@Velocity 

New column in Table_A

New Column = if(isblank(countx(filter(Distinct_Table_B,Distinct_Table_B[Field_B]= Table_A[Field_A] ),Distinct_Table_B[Field_B])),"No","Yes")



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Super User IV
Super User IV

Re: Unable to create a column based on relationship with another table

Hi,

In Table_A, create this calculated column formula

=IF(ISBLANK(RELATED(Distinct_Table_B[Field_B])),FALSE(),TRUE())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Highlighted
Super User IV
Super User IV

Re: Unable to create a column based on relationship with another table

@Velocity 

New column in Table_A

New Column = if(isblank(countx(filter(Distinct_Table_B,Distinct_Table_B[Field_B]= Table_A[Field_A] ),Distinct_Table_B[Field_B])),"No","Yes")



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Helper II
Helper II

Re: Unable to create a column based on relationship with another table

Thanks @amitchandak. However, i have not understood the role of countx in this expression. Can you please explain?

Highlighted
Super User IV
Super User IV

Re: Unable to create a column based on relationship with another table

I am creating a calculating column to get data from unrelated tables using the choice of filters. So I just counted if it present in another table. It will return blank for no match. We can also use minx and maxx.

 

** unrelated  - the way we are using it as of now.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper II
Helper II

Re: Unable to create a column based on relationship with another table

@amitchandak 

...but since the tables are related (There is a one to many relation built from Field_B to Field_A), is there a better way of handling it? When there are millions of records in Table_A, it will be very time consuming.

Highlighted
Super User IV
Super User IV

Re: Unable to create a column based on relationship with another table

Hi,

In Table_A, create this calculated column formula

=IF(ISBLANK(RELATED(Distinct_Table_B[Field_B])),FALSE(),TRUE())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Highlighted
Helper II
Helper II

Re: Unable to create a column based on relationship with another table

Thanks @Ashish_Mathur 

Highlighted
Super User IV
Super User IV

Re: Unable to create a column based on relationship with another table

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors