How to get the value from referenced table

I have a table named “Order Details”, it has many columns but two referenced columns relevant here are"Customer Name" and “Area”. What I wanna do, is when in “Order Details” table, I select Customer name from dropdown list of referenced value of “Customer Details” table. Area name available in “Customer Detail” table should be filled automatically in the “Order details” area column. Can you understand me? Please help

1 Like

Use a SELECT expression in the ‘Area Name’ column. I guess you have a key column set up in the Customer detail table. Let’s assign a different column name for Customer Name in the Order details Table, say, Cus_Name, for convenience.

SELECT(Order Details[Area], ([Customer Name] = [_THISROW].[Cus_Name])

With this you are ‘Selecting’ the value from Area column in the Order Details table, where the Customer Name is the one you are selecting in THIS very ROW.

In such situations, SELECT expressions work very well.
Hope this helps.

1 Like

@Countryboy_OmEr ,

It sounds that you are referencing the “Customers Details” table in the “Orders Details” table. In that case you may use the standard method of dereferencing to pull other fields from the Customers table in the orders details table.

For example [Customer Name].[Area] to pull the area from the “Customers Details” table in the “Orders table” where [Customer Name] is rhe reference type column in the “Orders Details” table.

2 Likes

I couldn’t understand the answers, let me explain again
1st table I have “Area” table
Which have column Area Name like dubai, sharjah

2nd table, Customer Details table
Which have customer details with reference to area in 1st table
For example, customer John from Dubai

3rd table I have is Order Details which has reference from Customer Details table and Area table

Now what I wanna do is, when I add an order in order details, and I add customer name from referenced dropdown of customer table , area of the customer should also be added automatically to order details’ area column.
I don’t know how to do it with SELECT because it’s saying it’s result is list and it can’t be used here.

Hi @Countryboy_OmEr,

Thank you for moe details. Earlier you had not mentioned the presence of a separate "Area: table.

Anyway, if you already have pulled area details in the customer table as mentioned below , any specific reason you are again referring area table in Orders detail table?

Since you already have
area details available in Customer table, I believe you could pull the area information from the "Customer " table in the Order details table through dereferencing.

Were yuou able to take a look at dereferencing concept article?

1 Like

Thanks brother, dereferencing worked. It was easy, have a great time

1 Like