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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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