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 Apps
Unanswered

I need a Formula

(0) ShareShare
ReportReport
Posted on by 23

I am trying to get a formula to suit the following situation:

- I have a data file with multiple columns of data.

- Essentially they get entered as categories say for example ice cream flavours. 

- I have 3 entries for chocolate inventories, wednesday it was 15 litres, thrusday it was 20 litres. 

- how do i get a formula to tell me what the difference is? i can use lookup to tell me what the first entry was but im having trouble with the negative value (what to take off that original value) in other words how to i look for the last value in a particular column?

Categories:
I have the same question (0)
  • bean Profile Picture
    568 on at

    If you could describe a bit better on how you want this to work, I might be able to write some code.

    However, if you just want to work out the difference between two dates, you could simply just do two Lookups.. e.g.

     

     

    UpdateContext({difference:
    Abs(
    LookUp(first value).litres-LookUp(second).litres
    )
    })

     

  • bean Profile Picture
    568 on at

    In addition, to find the last row in a table, you can use Last() & LastN().

     

    https://powerapps.microsoft.com/en-us/tutorials/function-first-last/

  • SamuelParkes Profile Picture
    23 on at

    Yeah i think this is the right way to go, however how to i use the filter with the first() and last() formulas? 

  • bean Profile Picture
    568 on at

    Sorry - I may have set you in the wrong direction. I think, if you are using last() and first(), you would not use that with a filter.

     

    So to simply get the last row, Last(datasource). To get a column value from last... I think you could try Last(datasource).columnname?

     

    If you want the second to last row.. this is where things get a bit hacky. You would need to go First(LastN(datasource,2)).columnname

     

    Hope that helps!

     

    Sean

  • SamuelParkes Profile Picture
    23 on at

    Thanks heaps for your help. One more thing.. 

    I got it to work the other day when i used the following formula:

    first(filter(source,column name = dropdown.selected.value).column to return) then i did the same thing with last formula. 

    i did that and it worked but now im getting the following error:

    "The property expects Text values, but this rule produces incompatible Record values."

    Understanably its hard to understand where im at without knowing the sources/columns etc. But any help you can give would be greatly appreciated!!

    Thanks so much 

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard