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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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