Skip to main content

Notifications

Community site session details

Community site session details

Session Id : bPZe6FBofy0hetN1w/K6o0
Power Apps - Microsoft Dataverse
Answered

Using lookups with calculated fields

Like (0) ShareShare
ReportReport
Posted on 5 Aug 2023 03:47:21 by 31

I have a custom table that I'd like to add a field to that concatenates the values from a related row in another table. For example, in a table that contains line items for an order, I want to add a field that displays the name and description of an item. The name and description exist on the Items table.  The 'Line Item' table has a relationship connection to the Items table and the Orders table.

 

My first instinct is to create a calculated field that concatenates the item name and item description, but I'd like to avoid adding those columns to the 'Line Items' table if possible.

 

What's the best way to accomplish this? 

  • Gprior Profile Picture
    142 on 27 Nov 2023 at 14:34:14
    Re: Using lookups with calculated fields

    OH MY! I've been searching for this specific help for weeks! Thanks a lot!!!! I confirm it worked perfectly... the idea that the relation between table is an object and it is flexible is mind blowing!! Thank you again!

  • steeevid Profile Picture
    319 Super User 2024 Season 1 on 05 Aug 2023 at 08:25:44
    Re: Using lookups with calculated fields

    Yes when you created a lookup column you created a relationship, then power fx is able to explore the relationship like an object.

  • SescoDev Profile Picture
    31 on 05 Aug 2023 at 08:13:22
    Re: Using lookups with calculated fields

    Thank you, that worked like a charm. Some things I learned in the process:

     

    1) The related table needs to be a lookup column.

     

    2) Use the name of the lookup column, not the name of the lookup table. Example:

    If I have Table "Line Items," a table named "Products" with the columns "name" and "description," and a lookup column in "Line Items" called "item", then for a column in "Line Items" that returns the composite name and description, I'd use this formula:

    concatenate('item'.name & " " & 'item'.description)

     

    Thanks for pointing me in the right direction, I hadn't even realized that I could use PowerFX as a column type! This opens up a lot of exciting possibilities.

  • Verified answer
    steeevid Profile Picture
    319 Super User 2024 Season 1 on 05 Aug 2023 at 07:02:04
    Re: Using lookups with calculated fields

    Not sure how the relationship in your system works, it sounds like you have 3 or 2 tables?

     

    Anyway, use power fx formula column in the target table:

     

    formula example:

     

    concatenate('Item'.name, 'Item'.description)

     

    feel free to add any fixed seperator in the concatenate function to divide the text

     

    Never use calculated field, they are **bleep**

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Loading started
Loading complete