web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Group by sum label

(0) ShareShare
ReportReport
Posted on by 109

Hello, I want to collect the products I have sold on different dates by grouping them in a single line for micros Kod

 

My Gallery cod is here

With({_data: Filter(konsol; CUSTOM_GURUP = Dropdown17_8.Selected.Result &&
Tarih >=dpfrom.SelectedDate && Tarih <=dpto.SelectedDate
 )};
 With({_innerData:
 AddColumns(_data;
 "_sum"; Sum(_data; SALES);
 "_pop"; Average(_data; SALES);
 "_cost"; COSTPRICE / NET_SALES_PRICE;
 "total_sales"; SALES*NET_SALES_PRICE
 )
 };
 AddColumns(_innerData;
 "_costAvg"; Average(_innerData; _cost))))
 

 

 

 

dursunzeeee_0-1615588871314.png

 

Categories:
  • WarrenBelz Profile Picture
    156,738 Most Valuable Professional on at

    Hi @dursunzeeee ,

    The below is free-typed (so watch commas/brackets etc), but the below is the structure you need for nested With() statements.

    With(
     {
     _innerData:
     With(
     {
     _data: 
     Filter(
     konsol; 
     CUSTOM_GURUP = Dropdown17_8.Selected.Result && 
     Tarih >=dpfrom.SelectedDate && 
     Tarih <=dpto.SelectedDate
     )
     };
     AddColumns(
     _data;
     "_sum"; 
     Sum(_data; SALES);
     "_pop"; 
     Average(_data; SALES);
     "_cost"; 
     COSTPRICE / NET_SALES_PRICE;
     "total_sales"; 
     SALES*NET_SALES_PRICE
     )
     ) 
     },
     AddColumns(
     _innerData;
     "_costAvg"; 
     Average(_innerData; _cost)
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • dursunzeeee Profile Picture
    109 on at

    Hello, thank you very much for your help, but I've been trying to learn powerapps for 10 more days.

    When adding the code you shared with the gallery, it failed. 😞

  • WarrenBelz Profile Picture
    156,738 Most Valuable Professional on at

    @dursunzeeee ,

    That does not help me - I was using your values which may be invalid. I need to know what is invalid and the error message.

    Also if you are new to Power Apps, why are you attempting such a complex With() statement?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard