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 Platform Community / Forums / Power Apps / bar chart based on sta...
Power Apps
Unanswered

bar chart based on star rating

(0) ShareShare
ReportReport
Posted on by 28

I am using the star rating control and wanted to do a bar chart based on the ratings.
I am new to powerapps and got lost when I tried something like item = Filter(CustomerTable,Text (DataCardValue12.value)

 

Can anyone advice me? Thanks so much.

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @myonlywan

     

    Maybe you could give a bit more details but here is how to create simple Ratings for few items and show them on bar chart.

     

    In Screen.Visible put this function to create a collection which will hold item names and their ratings:

     

    ClearCollect(Ratings,{Name:"Item1",Rating:0},{Name:"Item2",Rating:0},{Name:"Item3",Rating:0})

    1.png 

     

     

    For each Rating select the Rating Control and in Rating.OnChange put this function to record the change in ratings:

    Patch(Ratings,LookUp(Ratings,Name="Item1"),{Rating:Rating1.Value})

     For each rating you will have to replace Item1 and Rating1 with corresponding Item name and Rating Control name

     

    2.png

     

    Add bar chart and select it, in ColumnChart.Items put this function to display the ratings:

     

    Ratings

     

    The graph changes live as you select different ratings for each item.

  • myonlywan Profile Picture
    28 on at

    Thanks for the example...i'll try it out.

    In my use case, i have an excel file with

    item 1 rating

    item 2 rating

    item 3 rating

     

    Using  a new screen,I am trying to do a pie or bar chart so that i can see the average rating for item 1,2 & 3.
    I think is can be done using powerapps but i dont know how. 


    Any advice is grateful.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @myonlywan,

     

    Could you please share a bit more your app's configuration?

    Could you please more details about your Excel file?

    Further, do you want to display the average rating for item 1 ,item2 and item3 using Bar char control within your app?

     

    If you want to see the average rating for item 1, 2, 3 using Line chart or Pie chart within your app, I afraid that there is no way to achieve your needs in PowerApps currently.

     

    If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

     

     

    Best regards,

    Kris

     

  • myonlywan Profile Picture
    28 on at

    Capture.PNG1.PNG

    @v-xida-msft@AnonymousThe excel has 2 sheet, 1 sheet for "mainlogfile" and another sheet for "productname"

    in a new screen, is it possible to show in a drop down box, the average rating for each product in a pie chart?

    123.PNG

    I tried using pie chart - item = productname. i can see the legend , but the pie chart is not showing up. Any idea?

    Capture.PNG

     

    Thanks so much.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @myonlywan,

     

    Do you want to display the average rating (the average rating of Rating1&Rating2&Rating3) for each product team in the Pie chart control?

     

    If you want to display the average rating (the average rating of Rating1&Rating2&Rating3) for each product team in the Pie chart control, I have made a test on my side, please take a try with the following workaround:5.JPG

     

    Set the Items property of the Pie chart control to following formula:

    AddColumns(
    GroupBy(mainlogfile,"ProductName","GroupData"),
    "AverageRating",
    Sum(ForAll(GroupData,Rating1+Rating2+Rating3),Value)
    )

    Note: The mainlogfile represents the mainlogfile table in your Excel file.

     

    But the Pie chart control could not display the detail value for the average rating of each product currently, as an alternative solution, you could consider take a try to add a Label control beside each pie as below:

    6.JPG

     

     

    Set the Text property of the Label1 control to following:

    LookUp(AddColumns(GroupBy(mainlogfile,"ProductName","GroupData"),"AverageRating",Sum(ForAll(GroupData,Rating1+Rating2+Rating3),Value)),ProductName="Apple").AverageRating

    Set the Text property of the Label2 control to following formula:

    LookUp(AddColumns(GroupBy(mainlogfile,"ProductName","GroupData"),"AverageRating",Sum(ForAll(GroupData,Rating1+Rating2+Rating3),Value)),ProductName="Watermelon").AverageRating

    Set the Text property of the Label3 control to followig formula:

    LookUp(AddColumns(GroupBy(mainlogfile,"ProductName","GroupData"),"AverageRating",Sum(ForAll(GroupData,Rating1+Rating2+Rating3),Value)),ProductName="Banana").AverageRating

    Set the Text property of the Label4 control to following formula:

    LookUp(AddColumns(GroupBy(mainlogfile,"ProductName","GroupData"),"AverageRating",Sum(ForAll(GroupData,Rating1+Rating2+Rating3),Value)),ProductName="Orange").AverageRating

     

    Best regards,

    Kris

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard