web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dataverse Power fx for...
Power Apps
Unanswered

Dataverse Power fx formula for columns in 2 different tables

(0) ShareShare
ReportReport
Posted on by

Hi! I want to add a subtraction formula for my column in table A but the other column is in table B [Column 1 (Table A) - Column 2 (Table B)].

 

Is this possible? 

 

 

I have the same question (0)
  • AhmedSalih Profile Picture
    6,678 Moderator on at

    Hello, @Anonymous, yes it is doable if you have a relationship between the two tables. You have to have a Lookup Column in Table A that is linked to Table B. Use a formula that looks something like this:

    (TableAvalue-LookUpColumnName.ColumnNameInTableB) << ColumnNameInTableB is where you have your value to subtract.

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

     

  • Community Power Platform Member Profile Picture
    on at

    @AhmedSalih thank you so much!! one last question, how do I set the look-up column in table B?  when I set up the lookup column, it somehow automatically chose a column in table B. I wanted to select another column.

  • AhmedSalih Profile Picture
    6,678 Moderator on at

    @Anonymous, can you share your tables schemas? the Columns' names and data samples? Also, do you have a Primary Key and Foreign Key?

  • Community Power Platform Member Profile Picture
    on at

    Hi @AhmedSalih here are my tables and the relevant columns. The YEAR MAKE MODEL TRIM column will be the lookup value where for example for a 2022 Chevrolet Silverado 1500 WT vehiclethe Quantity to Buy is = 5, then 2 vehicle purchasers (person A and person B) each were able to buy 1 car of the exact vehicle  type (2022 Chevrolet Silverado 1500 WT). The updated quantity to buy should now be 3 given the formula below in Table A.

    TABLE A - Vehicles to Purchase

    Columns:

    1. Year Make Model Trim
    2. Quantity to Buy
    3. Updated Quantity to Buy = Quantity to Buy - Number of Vehicles Bought

     

    TABLE B - Purchase Vehicles

    1. Year Make Model Trim
    2. Number of Vehicles Bought

    I don't have a Foreign and Primary Key

  • Community Power Platform Member Profile Picture
    on at

    following up on this?

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard