cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OsmandFernando
Post Prodigy
Post Prodigy

Further on Collection

Hi @PowerAddict and other experts, 

 

I have done a collection using the following formula and it looks ok

 

ClearCollect(SalesbyLocation,ShowColumns(SalesTable,"SalesYear","SalesMonth","Customer_x0020_Name_x003a_Root_x","Total_x0020_Invoice_x0020_Value"));

 

Following is how it looks like, the Root comes as a group with ID and Value. 

 

Following are my requirements, 

 

1. How can I get the Customer Name root..... with value only to my current collection

2. How can I create a collection to show the Total Invoice Value by Location (total must be summarized by location)

 

Capture.PNG

 

Capture1.PNG

 

Thank you

Osmand

1 ACCEPTED SOLUTION

Accepted Solutions
PowerAddict
Super User II
Super User II

The answer to your first question should be the AddColumns function. So something like this might help:

ClearCollect(SalesbyLocation,ShowColumns(AddColumns(SalesTable,"CustomerName", Customer_x0020_Name_x003a_Root_x.Value), "SalesYear","SalesMonth","CustomerName","Total_x0020_Invoice_x0020_Value"));

Let me know if this doesn't work. The answer to your question is the GroupBy function. I will try to pit an example together as soon as I get in front of a computer.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com

View solution in original post

4 REPLIES 4
PowerAddict
Super User II
Super User II

The answer to your first question should be the AddColumns function. So something like this might help:

ClearCollect(SalesbyLocation,ShowColumns(AddColumns(SalesTable,"CustomerName", Customer_x0020_Name_x003a_Root_x.Value), "SalesYear","SalesMonth","CustomerName","Total_x0020_Invoice_x0020_Value"));

Let me know if this doesn't work. The answer to your question is the GroupBy function. I will try to pit an example together as soon as I get in front of a computer.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com

View solution in original post

Were you able to solve this? If not, let me know what questions you have and I can try to solve them now.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://www.thepoweraddict.com

Thank you @PowerAddict your direction is helping me lot. 

 

I was able to find an answer to the 2nd question by my own, i applied the following and it worked

 

ClearCollect(SalesSumbyLocation,AddColumns(GroupBy(SalesbyLocation,"CustomerLocation","Grouped"),"TotalSales",Sum(Grouped,Total_x0020_Invoice_x0020_Value)));
 
Osmand

@OsmandFernando that's great work! Good luck with the rest of the app! Feel free to reach out in case of any questions!

Thanks,
Hardit Bhatia
https://thepoweraddict.com

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,941)