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 / how to count a column ...
Power Apps
Answered

how to count a column based on another column

(0) ShareShare
ReportReport
Posted on by 52

my table name is WorkOrder, and i would like to have a workorder number that shows all the vendor names for a particular job address and also count the vendor names for a particular job address.. eg for address 711., i want to be able to see all vendor names allocated to that address and also count the number of vendors in that address, instead of the repetition

Screen Shot 2021-05-31 at 2.36.57 PM.png
Categories:
  • v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @tbabe12 ,

    Where do you want to show these count numbers? In a gallery?

    Do you want to show all vendor names when click a specified address in another gallery?

    Please provide more information about your requirement.

    Besides, I used to solved a thread that may be similar to yours, check if this is helpful to you:

    Solved: Re: Show only the first record with a condition in... - Power Platform Community (microsoft.com)

    Best regards,

    Allen

  • tbabe12 Profile Picture
    52 on at

    exactly, i would like to be able to show counts number like the picture below, and all vendors names for a specific address in another gallery.. yes. Wos is the WorkOrder counts for a specific address. Thanks

    Screen Shot 2021-06-01 at 7.25.53 AM.png
  • Verified answer
    v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @tbabe12 ,

    Sorry for my late reply.

    I now understand your requirement and I think the post provided in my first reply did match your need. Have you checked my solution in that thread?

    Anyway, I did a simple test on my side for your reference.

    1. Here is my data structure, one idcliente with more than one address1:

    v-albai-msft_0-1623144177412.png

    2. Here is my first gallery. The Items property of this gallery is:

    Distinct(Clientes,idcliente)

    For you, this should be:

    Distinct(WorkOrder,jobaddress) 

     

    v-albai-msft_1-1623144247825.png

    Inside this gallery, I add a label control and set its Text property to:

    CountIf(Clientes,idcliente=ThisItem.Result)

    For you, it should be:

    CountIf(WorkOrder,jobaddress=ThisItem.Result)

    v-albai-msft_4-1623144587228.png

    3. Here is my second gallery, the Items property of the second gallery is:

    Filter(Clientes,idcliente=Gallery4.Selected.Result)

    For you, it should be:

    Filter(WorkOrder ,jobaddress =Gallery4.Selected.Result)

    v-albai-msft_5-1623144775687.png

    Refer to above solution and do changes based on your actual needs.

    Best regards,

    Allen

     

  • tbabe12 Profile Picture
    52 on at

    Thank you so much for this..

     

  • tbabe12 Profile Picture
    52 on at

    Thanks for helping out, i just realized it isn't working for all of my address.. just wondering why it is selecting what to count. if you look at my screenshots, the 212 have repeated rows but it won't count it. it works well for the 187 address.. what do you think might be the issue?

    Screen Shot 2021-06-10 at 5.37.57 PM.png
    Screen Shot 2021-06-10 at 5.45.20 PM.png
    Screen Shot 2021-06-10 at 5.40.44 PM.png
  • v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @tbabe12 ,

    The information is rather limited, I cannot tell you why this happen. 

    Please provide some more information about the formula you are using(better with screenshots).

    Best regards,

    Allen

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard