cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Datatable

Hi,

In powerapps i have a datatable in that i have 3 columns
Product ID
ProductName
Count
I need count based on productid and product name i used groupby but i am unable to get count.

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Could you tell me

1)whether do you want to group based on productid and product name ,count the number of product that has the same productid and product name

or                                       group based on productid,count the number of product that has the same productid

                                           group based on product name,count the number of product that has the same product name?             

2)the formula that you used?

3)the structure of your table?

 

I've made a similar test for your reference:

I assume that both Product ID,ProductName  is text type,Count is number type.

1)group based on productid and product name

Try this formula:

AddColumns(GroupBy(tablename,"productid","product name","same product"),"Countnumber",Sum(same product,Count))

2)group based on productid:

AddColumns(GroupBy(tablename,"productid","same product"),"Countnumber",Sum(same product,Count))

3)group based on product name:

AddColumns(GroupBy(tablename,"product name","same product"),"Countnumber",Sum(same product,Count))

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable


I need this type
Group based on 
productid and product name ,count the number of product that has the same productid and product name
Eg:
ProdID     ProdName     Count
1                     x                3
2                     x                1
3                     z                2

Formula which i used
GroupBy(tablename,"col1","col2,"groupname")

Example Tableformat
ProdID     ProdName  
1                     x                
2                     x                
3                     z                
1                     x
1                     x
3                     z

And i tried formula which you sent but count number column 
is blank 

AddColumns(GroupBy(tablename,"productid","product name","same product"),"Countnumber",Sum(same product,Count))

Thank you @v-yutliu-msft 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Users online (1,219)