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 / How to set the bar wid...
Power Apps
Answered

How to set the bar width let them scale to fit the gallery

(0) ShareShare
ReportReport
Posted on by 109

Hi guys,

I create some bar in gallery which length is depending on 'sum of value'. My gallery width value is 640. So it will exceed the gallery width. I want all of the other bar sizes to be a ratio of that maximum size, based on 'sum of value'.

未命名3.png

Categories:
I have the same question (0)
  • kit1128 Profile Picture
    109 on at

    Need Help~~

  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @kit1128 

    To do this you would need to create a collection.  Put this code in the OnVisible property of your screen. 

    ClearCollect(
     myProjects,
     DropColumns(
     AddColumns(
     GroupBy(Filter(ETimeSheetMain, Title = UserMail),"Project","GroupedProjects"),
     "Sum of Value",Sum(GroupedProjects,WorkingHours)
     ),
     "GroupedProjects"
     )
    )

     

    Replace the code in the Items property of Gallery1 with this.

    myProjects

     

    Finally, use this code in the Width property of your bar.

    (ThisItem.'Sum of Values'/Max(myProjects,'Sum of Value'))*Gallery1.Width

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • kit1128 Profile Picture
    109 on at

    @mdevaney ,

    OMG, thank you so so so much!! You helped me a lot, you're awesome dude.

  • mdevaney Profile Picture
    29,989 Moderator on at

    @kit1128 

    It was an interesting problem.  I'm glad I could help 🙂

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 765 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 272

Last 30 days Overall leaderboard