cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Michel_FO
New Member

Group table by column

Hi Everyone , 

 

I have an application that is reading a list from Sharepoint, and I would like to sum/group the values ​​of Column CP5, CP6, CP7, CP8 based on Column Model. Is it possible to do that?

Michel_FO_0-1622654970858.png

 

I tried using the group by function as follows, but it didn't work:

 

 

 

GroupBy(
    'Saldo Produção'; 
    "MODELO";"OData__x0043_P5";"OData__x0043_P6";"OData__x0043_P7";"OData__x0043_P8")

 

 

Could someone help me?

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Community Champion
Community Champion

@Michel_FO Have a look at this,

 

The original data (I pulled it from Excel, but it doesn't really matter)

CNT_0-1622663423589.png

 

The Output in PowerApps DataTable

CNT_1-1622663491248.png

 

The Formula in the Items property of the DataTable

AddColumns(GroupBy(Models, "Model", "ModelsGroup"), "CP5", Sum(ModelsGroup, CP5), "CP6", Sum(ModelsGroup, CP6), "CP7", Sum(ModelsGroup, CP7), "CP8", Sum(ModelsGroup, CP8))

 

Please remember to give a 👍 and accept the solution as it will help others in the future.

View solution in original post

7 REPLIES 7
zmansuri
Community Champion
Community Champion

Is this inside gallery? If you want to sum the numbers displaying try this:

a48.jpg

Label8_7 is the name of the label inside my gallery. What it does is. Take all the values from label8_7. Convert it to number. Sum them and display. as text on another label which is outside gallery. As you can see in pic.

Michel_FO
New Member

Hi My Friend, 

 

I'm using the data table, which brings up the values ​​from a list in sharepoint.

I'm managing to add the sum, what I wanted to achieve and join the first two lines, for example: if I were using the SQL server I would do:

Select * from table
group by model, CP5, CP6, CP7, CP8

 

Michel_FO_0-1622656422235.png

 

CNT
Community Champion
Community Champion

@Michel_FO Have a look at this,

 

The original data (I pulled it from Excel, but it doesn't really matter)

CNT_0-1622663423589.png

 

The Output in PowerApps DataTable

CNT_1-1622663491248.png

 

The Formula in the Items property of the DataTable

AddColumns(GroupBy(Models, "Model", "ModelsGroup"), "CP5", Sum(ModelsGroup, CP5), "CP6", Sum(ModelsGroup, CP6), "CP7", Sum(ModelsGroup, CP7), "CP8", Sum(ModelsGroup, CP8))

 

Please remember to give a 👍 and accept the solution as it will help others in the future.

View solution in original post

CNT
Community Champion
Community Champion

@Michel_FO  Did you try it out? Is it working?

 

CNT
Community Champion
Community Champion

@Michel_FO Expecting some feedback! 🤔

Thanks very much!

CNT
Community Champion
Community Champion

@Michel_FO Glad to help!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,185)