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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Elisa_E
Helper I
Helper I

text from a related table

Hello, I have two related tables with a many to one relationship.

I am trying to pull the company variable into the second table using the RELATEDTABLE function and LASTNONBLANK but am getting an error. Is there another way I can proceed?  Thank you!

 

table 1.png 

 

 

 

 

 

 

 

 

table 2.png

 

1 ACCEPTED SOLUTION

Hi,

 

Using the Query Editor, you should be able to use the Merge feature to bring over the Company column from Table 1 to Table 2.  I can offer more help, if you can share the download link of the workbooks.


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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I think you need to use RELATED() instead of RELATEDTABLE().

 

RELATED() works on the "Many" side, and calls up to the "One" side to get the value you're looking for.

 

RELATEDTABLE() actually creates a table (crazy, I know) of all of the records that match the "One" side.  This table can't be visualized directly in a Power BI measure, but would be used as a parameter in another measure.

 

May I ask why you need the calculated column on the Many table in the first place?  Calculated columns tend to bloat the data model, and if you already have the relationship in place, you can use the "One" table in the visual, and a measure based on the "Many" table with no issues.

Thank you for the reponse. Perfectly clear. The issue is that I need to show a table visualization with columns fom both tables, but some companies in the second table are not included in the first and therefore do not show at all. What I need is to show all companies in the second table, with blanks in the respective columns if they are not present in the first. Is a merge query possible for two tables with a many to one relationship? Thanks again!

Hi,

 

Using the Query Editor, you should be able to use the Merge feature to bring over the Company column from Table 1 to Table 2.  I can offer more help, if you can share the download link of the workbooks.


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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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