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 Platform Community / Forums / Power Apps / Sum gallery by categor...
Power Apps
Unanswered

Sum gallery by category in nested gallery for entire program

(0) ShareShare
ReportReport
Posted on by 1,512

@RandyHayes has been awesome in helping me get this partially fixed now I am struggling with the next part.

 

I have a parent gallery and a nested gallery.  In the nested gallery I have several categories that I need to sum in total no matter the date in the nested gallery.

 

@RandyHayes  helped me to get the switch that allows the gallery to sum based on the any definition I want, however I am stuck on how to get the Program today sum by category.

 

Here is the switch code

Switch(ThisItem.Category,
 "Codes",Sum(ThisItem.Codes,Value),
 "Safety",Sum (ThisItem.Safety, Value),
 "BluePrints", Sum (ThisItem.BluePrints, Value),
 "Wiring Equip", Sum(ThisItem.WiringEqup, Value),
 "Install Substation Equip", Sum(ThisItem.InstallSubEquip, Value),
 "Install Disp Equipment",Sum (ThisItem.InstallDispEquip, Value),
 "Install Motors Generators", Sum(ThisItem.InstallMotorGen, Value),
 "Shop Work Elect Equip", Sum(ThisItem.ShopWkElecEq, Value),
 "Pwr Wiring Bus Bar Install", Sum(ThisItem.PwrWiringBusBar, Value),
 "Welding",Sum (ThisItem.Welding, Value),
 "OJT Meter Relay Tech", Sum(ThisItem.OJTMeterRelay,Value),
 "OJT Lineman", Sum(ThisItem.OJTLineMan, Value),
 "OJT Dist Dispatcher", Sum(ThisItem.OJTDisp, Value),
 "OJT Sr System Operator", Sum(ThisItem.OJTSRSysOp, Value),
 "RSI-Supvd", Sum(ThisItem.RSISupvd, Value), 
 "RSI-UnSupvd", Sum(ThisItem.RSIUnSupvd, Value),
 0
)

Here is an image of the Parent and nested gallery

Dorinda_0-1661782469620.png

 

What I am trying to do is in the Left in Category all years should be the same regardless of quarter or year, it is the sum of the program by category.

 

Here is the code on the Parent Gallery

Sort(
 GroupBy(
 Filter(
 'POWER SYSTEM ELECTRICIAN Work Hours',
 'Apprentice Name' = Upper(varCurrentUserFullName),
 'Year Entered' >= 2020,
 (IsBlank(Dropdown2.Selected.Result) || 'Year Entered' = Dropdown2.Selected.Result || 'Year Entered' = Dropdown2.Selected.Result)
 ),
 "QTR",
 "_data"
 ),
 QTR,
 Ascending
)

and here is the code for the nested

 

 With(
 {
 _data: AddColumns(ThisItem._data, "QTRS", ThisItem.QTR),

 _categories: With(
 {
 _ex: LookUp(
 'Apprentice List',
 'Apprentice Email'.DisplayName = varCurrentUserFullName,
 true
 )
 },
 Filter(
 Categories,
 'Category Type' = "Power System Electrician"
 )
 )
 },
 ForAll(
 _categories As _category,
 Patch(
 _category,
 {
 Codes: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: Code
 }
 ),
 Safety: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: Safety
 }
 ),
 BluePrints: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: Blueprints
 }
 ),
 WiringEqup: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'Wiring Equip'
 }
 ),
 InstallSubEquip: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'Install Substation Equip'
 }
 ),
 InstallDispEquip: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'Wiring Equip'
 }
 ),
 InstallMotorGen: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'Install Motors Generators'
 }
 ),
 ShopWkElecEq: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'Shop Work Elect Equip'
 }
 ),
 PwrWiringBusBar: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'Pwr Wiring Bus Bar Install'
 }
 ),
 Welding: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: Welding
 }
 ),
 OJTMeterRelay: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'OJT Meter Relay Tech'
 }
 ),
 OJTLineMan: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'OJT Lineman'
 }
 ),
 OJTDisp: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'OJT Dispatch'
 }
 ),
 OJTSRSysOp: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'OJT Sr System Oper.'
 }
 ),
 RSISupvd: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'RSI-Supvd'
 }
 ),
 RSIUnSupvd: ForAll(
 _data,
 {
 'Year Entered': Years,
 Value: 'RSI-UnSupvd'
 }
 )
 }
 )
 )
)

 

This is all working as expected except the last column I could really use some help on this!

Categories:

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 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard