cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vk3eka
Frequent Visitor

Distinct Columns in Datatable

Hi Guys,

 

I have a sharepoint list similar to this:-

 

Vehicle                 Cycles                        KMs       Date

Car1                         45                           1234       2/2/2021

Car2                         15                           234         2/2/2021

Car1                         48                           1278       3/2/2021

Car1                         51                           1293       4/2/2021

Car2                         25                           240         3/2/2021

Car1                         57                           1334       5/2/2021

 

I am trying to populate a datatable to show the following:-

Car1                         57                           1334       5/2/2021

Car2                         25                           240         3/2/2021

 

Ideally something like Last(Filter(Vehicle_Data, Vehicle = "Car1")) but with Distinct(Vehicle_Data, Vehicle) in place of “Car1”.

 

Any ideas as to how I can achieve this?

 

Thanks

 

Peter

1 ACCEPTED SOLUTION

Accepted Solutions

Bof,

 

Many thanks, works a treat.

 

Cheers

 

View solution in original post

4 REPLIES 4
Jagadeeshk
Responsive Resident
Responsive Resident

Try below

Addcolumn(Distinct(Vehicle_Data, Vehicle), "Date", lookup(vehicle_data,Vehicle =result,date)).

Note :Distinct is non delegable

Drrickryp
Super User
Super User

@vk3eka 

Sorry still working on it.

v-bofeng-msft
Community Support
Community Support

Hi @vk3eka :

Please try this formula:

ForAll(
  Distinct(YourSPList, Vehicle),
  LookUp(Sort(YourSPList,Date,Descending),Vehicle=Result)
)

Best Regards,

Bof

Bof,

 

Many thanks, works a treat.

 

Cheers

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,157)