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 / Pie Chart count the 2 ...
Power Apps
Unanswered

Pie Chart count the 2 Data sharepoint list

(0) ShareShare
ReportReport
Posted on by 28

Hi i have a question

i have a 2 Sharepoint list which is SampleData1 and Confident_1

 

I need to show the value of counts of these 2 sharepoint list

 

AddColumn(GroupBy(SampleData1, "Username", "Groupcolumn), "Count of Username", CountRows(Groupcolumn)

+AddColumn(GroupBy(Confident_1, "Lastname", "Groupcolumn), "Count of Lastname", CountRows(Groupcolumn) )


Seems doesnt work how to count 2 column? i hope someone responds soon thank you in advance! 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    Hi @shientylee ,

    You are not adding the fields

    AddColumns(
     GroupBy(
     SampleData1, 
     "Username", 
     "Groupcolumn"
     ),
     "Count of Username", 
     CountRows(Groupcolumn)
    ).'Count of Username' +
    AddColumns(
     GroupBy(
     Confident_1, 
     "Lastname", 
     "Groupcolumn"
     ), 
     "Count of Lastname", 
     CountRows(Groupcolumn)
    ).'Count of Lastname'

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • shientylee Profile Picture
    28 on at

    Hello i tried this code but i have an error with invalid argument type. Expecting one of the  following Number, Text or Boolean.

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    @shientylee ,

    You can try this, but it is really the same thing

    With(
     {
     wUser:
     AddColumns(
     GroupBy(
     SampleData1, 
     "Username", 
     "Groupcolumn"
     ),
     "UserCount", 
     CountRows(Groupcolumn)
     ),
     wLast:
     AddColumns(
     GroupBy(
     Confident_1, 
     "Lastname", 
     "Groupcolumn"
     ), 
     "LastCount", 
     CountRows(Groupcolumn)
     )
     },
     wUser.UserCount + wLast.LastCount
    )

    I assume you are putting this on a Label

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    Hi @shientylee ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • shientylee Profile Picture
    28 on at

    Hello sorry for the late reply. im still getting the error Text Number or Boolean. still finding a alternative way or looking to fix the error. 🙂 

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    Hi @shientylee ,

    What type of fields are UserName and LastName ?

  • shientylee Profile Picture
    28 on at

    They are Text 

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    @shientylee ,

    I can see the issue now - the sum of all of that is just going to the total number of records in both lists. Each set on its own will simply place a total of each grouped field in that record. Adding them up (which you could do with (but it is pointless)

    With(
     {
     wUser:
     Sum(
     AddColumns(
     GroupBy(
     SampleData1, 
     "Username", 
     "Groupcolumn"
     ),
     "UserCount", 
     CountRows(Groupcolumn)
     ),
     UserCount
     ),
     wLast:
     Sum(
     AddColumns(
     GroupBy(
     Confident_1, 
     "Lastname", 
     "Groupcolumn"
     ), 
     "LastCount", 
     CountRows(Groupcolumn)
     ),
     LastCount
     )
     },
     wUser + wLast
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • shientylee Profile Picture
    28 on at

    Hello i tried this but for now i got number values which are incompatible :c  

    i can work this with 1 Collection List but 

    with this 2 collection list  or 2 data sources still having hard time to fix it. sorry 😞 

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    @shientylee ,

    What I am saying is that you are wasting your time with that structure - you can count both lists

    CountRows(SampleData1) + CountRows(Confoident_1)

    The AddColumns(GroupBy( . . .)) puts an individual total in each grouped record, so you either want individual totals the you will have a Table), or add them all up which is the same as the above.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard