I have a requirement. I am trying to figure out using groupby , addcolumns but unable to achieve what i need.
I have a table like below with user and candy. I want to create a new gallery where the users information is stored along with the no of candy allowed. (So if for example Antony occurs more than 3 times , then the Maximum column should be 3, if its less than 3 , then no issue)
Expected table into a Gallery
Set the Items property of your Gallery to:
AddColumns(GroupBy(yourDataSource, "User", "_recs"), "_maximum", CountRows(_recs))
Set a label in the Gallery to ThisItem.User and another to ThisItem._maximum
I hope this is helpful for you.
Thanks for helping.
Actually using that query gives me the sum however what i am looking for is a if condition. if the users (e.g Antony) has the candy count of more than 3 times then the Table/Gallery should have Antony in Users and 3 in Maximum.
if the count is less than 3, then we leave the count as it is.
I'm not exactly understanding that logic. If the candy count is a count of the records for that user, are you saying if it is more than 3 that it should just show 3, and if less than 3, should be the count?
Check out new user group experience and if you are a leader please create your group
Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.