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

Solved Solved
2 5 1,556
1 ACCEPTED SOLUTION

@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.

View solution in original post

5 REPLIES 5

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.

@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.

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?

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

Top Labels in this Space