cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AliciaDG
Helper III
Helper III

Sum Function for Data table

Hi,

 

I have a data table that pulls data from a dropdown box and pulls information from a table.

 

What i am trying to do is figure out what the total number of Adults and kids where at a location.

 

Also i am stumped on how to have a date as a filter as well that is connected to the data table.

 

Thank you 

34 REPLIES 34

Hi @AliciaDG ,

The code you are using for the totals of the gallery should work - what result are they producing?

For the date, the Distinct value will present as text, however dates are not straight-forward to reference. Are you looking to simply equal the date?

Filter(
   Church_Online_1,
   Text('Date of Service Joined:',ShortDate)=
   Text(DateValue(YourDateDropDown.Selected.Result),ShortDate)
)

 

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.

 

Hi @WarrenBelz ,

 

Thanks for below;

 

re; the formula for the totals in gallery it is pulling all the date. i only want the data that is selected for the location and the date.

 

re: date:

 

i want to be able if i filter the date in the dropdown box it will only give me the date for that specific information. 

with the date it has date and time submitted not sure how to shorten that if i even can.

 

which in turn will give me the ttl of adults and kids at that location as well.

 

Does that make sense. 

Hi @AliciaDG ,

Try this

Filter(
   Church_Online_1,
   Text('Date of Service Joined:',ShortDate)=
   Text(DateValue(YourDateDropDown.Selected.Result),ShortDate) &&
   'Which Campus are you joining from?'=Dropdown2.Selected.Result
)

 

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.

Hey @WarrenBelz ,

 

i really don't know what i am doing wrong. still coming up with an error

 

AliciaDG_0-1601029579119.png

 

Hi @AliciaDG ,

I was on the iPad at the time and could not test it. You do not need the DateValue conversion if the list originates from a date.

Filter(
   Church_Online_1,
   Text('Date of Service Joined:',ShortDate)=
   Text('DD:Date of Service'.Selected.Result,ShortDate) &&
   'Which Campus are you joining from?'=Dropdown2.Selected.Result
)

 

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.

 

Hi @WarrenBelz ,

 

Awesome that worked for the table function and now pulls data based on date and location. 

 

my last issue i am hoping you can help with is the sum function so on that data table. 

 

when i select both the location and time it filters the information i want to be able to see what the total of the adult and kids field is for the data selected.

 

i have been trying this formula but i know it isnt right.

Sum(Filter(Church_Online,'How many adults in the Service?_Column1'='How many adults in the Service?'),'How many adults in the Service?_Column1')

Hi @AliciaDG ,

Try this

Sum(
   Church_Online,
   'How many adults in the Service?_Column1'
)

If you just want to add up the gallery

Sum(
   YourGalleryName.AllItems,
   'How many adults in the Service?_Column1'
)

 

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.

Hi again,

 

both suggestions didnt work. i am trying to pull the data from a datatable. 

Hi @AliciaDG ,

I misunderstood the reference to Data Table. You cannot do this on a Data Table - it does not have elements you can reference for this type of function - you need a Gallery.

 

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.

All good i figured as much.

 

thank you @WarrenBelz for all your help. i think what i have done will work for the purpose i need. 

 

 

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,627)