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
Super User
Super User

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
Super User
Super User

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

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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