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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help with formula
Power Apps
Answered

Need help with formula

(0) ShareShare
ReportReport
Posted on by 87

I am trying to write a formula that pulls data from a table as a result. Below is the equation:

IfError(LookUp(DataTable1,'BMI Range_Column2'='BMI output','Price Per Area_Column2')),"$0")

 

Error states:

LipoLoHu_0-1691080699272.png

 

Categories:
I have the same question (0)
  • madlad Profile Picture
    2,637 Moderator on at

    It looks like you're comparing 2 control names, likely in the lookup.

    If you want to compare the values from these controls, you'll have to reference them more specifically.

    For example, if it's text boxes, add .Text to the end of the control names, like so:

    IfError(LookUp(DataTable1,'BMI Range_Column2'.Text='BMI output'.Text,'Price Per Area_Column2')),"$0")

     If it's dropdowns, use .Selected, datepickers are .SelectedDate, ect. 

     

    Hope this helps!

  • LH-23071616-0 Profile Picture
    87 on at

    @madlad I am now getting this error

    LipoLoHu_0-1691082208252.png

     

    LipoLoHu_1-1691082216374.png

     

  • madlad Profile Picture
    2,637 Moderator on at

    what exactly are 'BMI Range_Column3' and 'BI output'? This will tell us more specifically what to put

  • LH-23071616-0 Profile Picture
    87 on at

    BMI column range 3 

    LipoLoHu_0-1691082507507.png

    BMI output

    LipoLoHu_1-1691082566104.png

     

     

  • madlad Profile Picture
    2,637 Moderator on at

    Interesting - what part of the code is the error highlighted?

  • LH-23071616-0 Profile Picture
    87 on at

    LipoLoHu_0-1691084529309.png

     

  • madlad Profile Picture
    2,637 Moderator on at

    Oh I see now. If DataTable1 is the gallery, try using DataTable1.AllItems.

    Something like this:

    IfError(
     LookUp(
     DataTable1.AllItems,
     'BMI Range_Column2'.Text='BMI output'.Text,
     'Price Per Area_Column2'
     ),
     "$0"
    )

     

  • LH-23071616-0 Profile Picture
    87 on at

    Oddly enough, the AllItems is not a recognized function. I scrolled through all the options and I don't even see "items" as an option. 

     

    I also tried to choose price per area_1 as pictured below, and still couldn't fix it. 

     

    LipoLoHu_0-1691086417029.png

     

  • madlad Profile Picture
    2,637 Moderator on at

    Yet again, that's my bad 😥, I didn't connect the dots that it was a data table, and not a gallery or other datasource. It looks like you're correct, I don't think you can reference values within a datatable like this.

    However, if all you need is the value, you could replace "DataTable1" with the datasource for the table, and replace the column names with the values that make that column.

    It might take a bit of playing with, but it should be able to work.

  • Verified answer
    LH-23071616-0 Profile Picture
    87 on at

    thanks! I ended up using the below formula and it worked for me

     

    LookUp('Price Per Area_1',ThisRecord.'BMI Range'='BMI output'.Text,ThisRecord.'Price Per Area')

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard