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 / Sum ( or Total) of a v...
Power Apps
Unanswered

Sum ( or Total) of a value based on 2 drop down list

(0) ShareShare
ReportReport
Posted on by 158

Hi Team,

 

Was wondering if someone could help.

 

I have a Powerapp Canvas app which  records the number of IT Tickets raised by employees. 

I have 2 dropdown lists  - 1. One which filters on Department Names and 2. which filters on team names in the department.

e.g. Dropdown1 (Department Names ) - Department A, Department B

Dropdown2 (Team Names) -  Team A, Team B, Team C, Team D

I have a label next to the 2 dropdowns. The label counts the number of tickets raised.

I need the label to COUNT the number of tickets raised AS DEPENDING ON THE DROPDOWNS SELECTED.

I.e. If on the first dropdown Department A is selected then it would show ALL Tickets related to Department A.

If user then Department A and then Team A - it will show total number of tickets raised ONLY for Team A.

 I have had a go but the formula is only works when Dropdown 2 is selected.

 

CountRows(Filter('TicketsRaised', ('Team Level'.Value=Dropdown2.Selected.Value)))

 

I need it work so if Dropdown1 is selected and Dropdown2 is blank() (ie not selected) show all tickets at Dropdown1.

 

 

 

Categories:
I have the same question (0)
  • PTBBSolutions Profile Picture
    691 on at

    Hi @Manny123 ,

     

    Maybe you can try something like this:

    CountRows(
     If(
     !IsBlank(DropDown1.Selected.Value),
     Filter(
     TicketsRaised,
     YourColumn = DropDown1.Selected.Value
     ),
     Filter(
     TicketsRaised,
     OtherColumn = DropDown2.Selected.Value
     )
     )
    )
  • Manny123 Profile Picture
    158 on at

    Hi PTBBSolutions,

    Thanks for the reply.

     

    What I need is by default if no dropdowns are selected - to show all tickets raised.

    Then if Dropdown1 and or Dropdown2 is selected  the total will adjust to reflect the dropdown selections.

     

  • Verified answer
    PTBBSolutions Profile Picture
    691 on at

    Hi @Manny123 ,

     

    Just add one more condition:

    CountRows(
     If(
     Isblank(DropDown1.Selected.Value) And Isblank DropDown2.Selected.Value),
     TicketsRaised,
    			If(
    			!IsBlank(DropDown1.Selected.Value),
    			Filter(
    				TicketsRaised,
    				YourColumn = DropDown1.Selected.Value
    			),
    				If(!IsBlank(DropDown2.Selected.Value),
    				Filter(
    						TicketsRaised,
    						OtherColumn = DropDown2.Selected.Value
    						)
    				)
    			)
    )
  • Manny123 Profile Picture
    158 on at

    Hi 

    Many thanks for the replies. Much appreciated.

    I am getting errors messages when using the code above and replacing the dropdown1 and 2 names with mine.

     

    Not sure if this will help but I created dropdown 1 and dropdown 2 using the formula below:

     

    In Items: Dropdown1 

    [Blank(),"Department A", "Department B"]

     

    In Items: Dropdown2

    [Blank(),"Team A", "Team B", "Team C"]

  • PTBBSolutions Profile Picture
    691 on at

    What is the error you are receiving?

  • v-jefferni Profile Picture
    on at

    Hi @Manny123 ,

     

    If you are using Dropdown Controls, please try and change the "Allow Empty Selection" property to true instead of using Blank() in the Items.

     

    If you are using Combo box Controls, by default it could accept empty selection so Blank() is not necessary as well.

     

    I could not found any wrong in @PTBBSolutions 's codes except missing an opening parenthesis at line 3. If you have solved the issue with his codes, please consider accept that reply as the solution.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni

  • Manny123 Profile Picture
    158 on at

    Hi

    For some reason(s) the formula above is not working for me without giving errors. I am clearly doing something wrong on my side which I will carry on checking. I am happy to close the ticket as the syntax provided has been verified.

     

    Thanks.

  • PTBBSolutions Profile Picture
    691 on at

    Hi @Manny123 ,


    What is the error which you are receiving?

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard