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

Group and Sum Sharepoint List

Hi everyone, 

 

I have a sharepoint list that I need to import into a datatable in powerapps and then group on the vendor name and sum only a select columns whilst ignoring all other columns. 

 

I've tried using add columns/remove columns in conjunction with group by but I can't seem to get it to work.

 

Any help would be appreciated!

 

Thank You!

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Hi @bugs777 

 

Here is the Sample for the group by

 

 

 

DropColumns(
    AddColumns(
        GroupBy(
            AddColumns(
                'DataSource',
                "ColumnNameAlias",
                VendorName
            ),
            "ColumnNameAlias",
            "VendorGroup"
        ),
        "CountValue",
        CountRows(VendorGroup)
    ),
    "VendorGroup"
)

 

 

Change DataSource and VendorName column on this query.

 

And for Sum, you will be doing only for specific columns

 


Thanks,
Stalin - Learn To Illuminate

View solution in original post

2 REPLIES 2
StalinPonnusamy
Community Champion
Community Champion

Hi @bugs777 

 

Here is the Sample for the group by

 

 

 

DropColumns(
    AddColumns(
        GroupBy(
            AddColumns(
                'DataSource',
                "ColumnNameAlias",
                VendorName
            ),
            "ColumnNameAlias",
            "VendorGroup"
        ),
        "CountValue",
        CountRows(VendorGroup)
    ),
    "VendorGroup"
)

 

 

Change DataSource and VendorName column on this query.

 

And for Sum, you will be doing only for specific columns

 


Thanks,
Stalin - Learn To Illuminate

View solution in original post

bugs777
Frequent Visitor

So I have managed to get the formula working but the new column I want isn't showing in my datatable?

See screenshots of formula and resulting datatable

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,268)