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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Homaa
Frequent Visitor

How to create a field using another field from another table?

I have several tables from Saleforce database and I want to create a field in one of these tables using a field from another table. To do this, I created the relationship between these two tables in Model and this relationship is active and I can see it there.

Homaa_0-1662999224120.png

 

But when I want to create the new field (column), within Account table cannot find Event table for connection.

Homaa_1-1662999248871.png

 

Is there any other steps I should take to see the relationship?

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Homaa 

 

You can try the following methods.

Sample data:

vzhangti_0-1663055117908.png

1. Add a calculated column to the Account table.

Column:

Event value =
CALCULATE (
    MAX ( Event[Value] ),
    FILTER ( Event, [AccountID] = EARLIER ( Account[ID] ) )
)

Result:

vzhangti_1-1663055252352.png

2. On this basis, the SWITCH function is used.

Column = SWITCH(TRUE(),
[Event value]>50,"A",
[Event value]>20,"B",
"C")

Result:

vzhangti_2-1663055356930.png

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Homaa 

 

You can try the following methods.

Sample data:

vzhangti_0-1663055117908.png

1. Add a calculated column to the Account table.

Column:

Event value =
CALCULATE (
    MAX ( Event[Value] ),
    FILTER ( Event, [AccountID] = EARLIER ( Account[ID] ) )
)

Result:

vzhangti_1-1663055252352.png

2. On this basis, the SWITCH function is used.

Column = SWITCH(TRUE(),
[Event value]>50,"A",
[Event value]>20,"B",
"C")

Result:

vzhangti_2-1663055356930.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

DataInsights
Super User
Super User

@Homaa,

 

The function RELATEDTABLE allows you to access the table on the many side of a one-to-many relationship. It returns a table of values, so you'll need to use an aggregate function like MAX.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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