cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Usernametwice23
Helper III
Helper III

How to log clicks of a button choice filtered by customer selected prior and push most clicked to the top of gallery

Hi all 

Screenshot attached for reference.

I have a table in excel onedrive business with a column called 'CountOfClicks' where I am trying to record the number of clicks the user makes on the 'Description' column in the same table (Description column contains a list of fruit to pick from). The description column is based on a combo box selection where you can choose a customer of selection to sell the fruit to. So the 3 columns are - 'Description', 'Customer' and 'CountOfClicks'. 

 

On top of recording the clicks, I would like to push the most clicked choices up the top so it displays the most popular fruit in the gallery first dependent on which customer was selected in the combo box prior. Is this kind of thing possible? The whole purpose of this is to try and determine what kind of fruits are most popular with each customer and make it easier for the user to make a selection next time, as the most clicked fruit will be at the top of the gallery. 

 

I was able to make records of clicks based on the fruit selected but it's not filtered based on customer selection 

Set(currentRecord, LookUp(Table7, ThisItem.Description=ThisRecord.Description));
   Patch(Table7, currentRecord, {CountOfClicks: currentRecord.CountOfClicks + 1})

 

I guess the first step is to try and figure out how to filter the clicks based on the customers and then later see if it's possible to make the most clicked choices appear at the top for each customer. 

 

Thank you for any help!  

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Hi @Usernametwice23

 

  • Add Combo box "CustomerComboBox"
  •  Set Combo box Items Property Distinct(Table1.Customer, Customer).Result

Gallery - Items Property

 

 

 

With(
    {
        wCode: Sort(
            Filter(
                [@Table1],
                (IsBlank(CustomerComboBox.SelectedItems) || IsEmpty(CustomerComboBox.SelectedItems) || Customer = CustomerComboBox.Selected.Result)
            ),
            Value(CountOfClicks),
            Descending
        )
    },wCode
)

 

 

 

 

Sample

StalinPonnusamy_1-1627881203757.png

 

View solution in original post

3 REPLIES 3
StalinPonnusamy
Community Champion
Community Champion

Hi @Usernametwice23

 

  • Add Combo box "CustomerComboBox"
  •  Set Combo box Items Property Distinct(Table1.Customer, Customer).Result

Gallery - Items Property

 

 

 

With(
    {
        wCode: Sort(
            Filter(
                [@Table1],
                (IsBlank(CustomerComboBox.SelectedItems) || IsEmpty(CustomerComboBox.SelectedItems) || Customer = CustomerComboBox.Selected.Result)
            ),
            Value(CountOfClicks),
            Descending
        )
    },wCode
)

 

 

 

 

Sample

StalinPonnusamy_1-1627881203757.png

 

View solution in original post

Usernametwice23
Helper III
Helper III

Hi @StalinPonnusamy 

 

Thanks for your help. Taking a look now! 

Thanks @StalinPonnusamy  This resolved how to sort the most clicked buttons which is a huge help. Just need to figure out how to log the clicks based on the customers. I created a new post for this issue. Thanks again. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,510)