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 / Condition information ...
Power Apps
Answered

Condition information of a label based on dropdown selecction

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I want to condition a label to show information based on the dropdown selection that I have, but it has a trick.

If the dropbox is empty I need to show me the sum of all the items that I have in the Gallery, but if the dropbox is selected the label information only have to show the sum of the filtred information.

 

The formula that I have is this one:

If((Sum('Visitas para ventas';'Visitas realizadas')/Sum('Visitas para ventas';'Visitas programadas'))>=0.95;"Cumpliendo";If((Sum('Visitas para ventas';'Visitas realizadas')/Sum('Visitas para ventas';'Visitas programadas'))>=0.9;"A mejorar";If((Sum('Visitas para ventas';'Visitas realizadas')/Sum('Visitas para ventas';'Visitas programadas'))<0.9;"Incumpliendo")))

 

This works but only to sum all the items, I´m struggling to add a condition for a sum of the selected option in the dropdown.

The data is conected by a sharepoint list.

Thanks

Categories:
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    If the label is the sum of what is in the gallery couldn't you based the formula on the gallery results instead of applying the same filters to the Sum().

     

    Example: Sum(Gallery.AllItems, 'FieldToSum')

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    I´m sorry is not onlie the sum, it has to sum the values of two columns of a sharepoint list and divide the totals, so the resultof the label is compare to a goal and display "Cumpliment";"To improve";"Inconpleate"

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    What @Jeff_Thorpe  means is that using Gallery.AllItems to represent the tablename.

    Since no matter what the drop down selects, Gallery.AllItems could represent the table that you want to sum.

    So please try this:

    1)Set the gallery's Items:

    If(IsEmpty(drop down.Selected),'Visitas para ventas';
    Filter('Visitas para ventas';fieldname=drop down.Selected.value)

    2)the sum result:

    If((Sum(Gallery1.AllItems;'Visitas realizadas')/Sum(Gallery1.AllItems;'Visitas programadas'))>=0.95;"Cumpliendo";
    (Sum(Gallery1.AllItems;'Visitas realizadas')/Sum(Gallery1.AllItems;'Visitas programadas'))>=0.9;"A mejorar";
    (Sum(Gallery1.AllItems;'Visitas realizadas')/Sum(Gallery1.AllItems;'Visitas programadas'))<0.9;"Incumpliendo"
    )

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks that really works.


    @v-yutliu-msft wrote:

    Hi @Anonymous ,

    What @Jeff_Thorpe  means is that using Gallery.AllItems to represent the tablename.

    Since no matter what the drop down selects, Gallery.AllItems could represent the table that you want to sum.

    So please try this:

    1)Set the gallery's Items:

    If(IsEmpty(drop down.Selected),'Visitas para ventas';
    Filter('Visitas para ventas';fieldname=drop down.Selected.value)

    2)the sum result:

    If((Sum(Gallery1.AllItems;'Visitas realizadas')/Sum(Gallery1.AllItems;'Visitas programadas'))>=0.95;"Cumpliendo";
    (Sum(Gallery1.AllItems;'Visitas realizadas')/Sum(Gallery1.AllItems;'Visitas programadas'))>=0.9;"A mejorar";
    (Sum(Gallery1.AllItems;'Visitas realizadas')/Sum(Gallery1.AllItems;'Visitas programadas'))<0.9;"Incumpliendo"
    )

     

    Best regards,


     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard