cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vgudipati
Frequent Visitor

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 @vgudipati ,

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.


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
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,973)