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 / Trying to identify uni...
Power Apps
Answered

Trying to identify unique records in a list

(0) ShareShare
ReportReport
Posted on by 380

I have a Sharepoint list called MeterReadings - the main columns are meterref (which identifies the Meter) , reading and readdate

A subset of the data looks like this:

meterrefreadingreaddate
81950000000015/3/20
81950000001517/3/21
82210009347010/2/20
82210009787010/3/21
82310136723731/3/21
82850017362931/3/21
83040009145611/3/20
83040009198611/3/21
8306000723328/3/21
83070029023112/3/20
83070029061017/3/21

I have a Gallery in my Powerapp and I want to put a button on it that filters the data so I can display single readings for a Meter - in the above case it would be metereref 8231, 8285 and 8306. Hope this makes sense.

thanks in advance 🙂

Categories:
I have the same question (0)
  • Torque Profile Picture
    36 on at

    Are you wanting the output to be a list of meter numbers and the sum of the readings?

    If so, this is a similar scenario:

    https://www.matthewdevaney.com/powerapps-collections-cookbook/group-by-and-find-the-sum/

    And then filter the list according to the meters the user wants to see

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @bobgodin ,

    Assuming the single reading you want is the latest reading

    AddColumns(
     GroupBy(
     Sort(
     MeterReadings,
     readdate,
     Descending
     ),
     "meterref",
     "Data"
     ),
     "Reading",
     First(Data).reading,
     "ReadDate",
     First(Data).readdate
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • bobgodin Profile Picture
    380 on at

    @WarrenBelz thanks Warren but not quite what I was looking for - I should have showed you the result I wanted - like this:

    meterrefreadingreaddate
    82310136723731/3/21
    82850017362931/3/21
    8306000723328/3/21

    I just want to see Meters that have only 1 read against them like the table above

    thanks

  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @bobgodin ,

    Like this

    AddColumns(
     Filter(
     GroupBy(
     MeterReadings,
     "meterref",
     "Data"
     ),
     CountRows(Data) = 1
     ),
     "Reading",
     First(Data).reading,
     "ReadDate",
     First(Data).readdate
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Verified answer
    bobgodin Profile Picture
    380 on at

    @WarrenBelz thanks Warren - I had to add a comma after CountRows(Data) = 1 ) but that formula worked a treat thank you 🙂

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Thanks @bobgodin ,

    Now fixed - dangers of free-typing code without red lines to guide.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard