@rpitts
Another method you can do to put your Formulas in one place is what I call a dynamic variable.
You would need to get rid of the collection (as you most likely don't need it anyway) and simply utilize this global "variable".
Here's how it works...
There are really only two controls in the PowerApps arsenal of controls that will give you IT's items. Those are the Gallery (the AllItems property - which is a bit of extra overhead you don't need) and a DataCard.
When I mention DataCard everyone thinks - Forms. But this is not the case, there is one other control that contains a datacard, and that is a Canvas control - this is perfect for this (and in fact, from our app design perspective we probably use Collections less than 1% of the time and these DataCards over 99% of the time - They work great and completely change how you design your apps, not to mention speed them up!).
Now, you cannot add a Canvas or DataCard directly from the insert menu. So what to do? You need to add a new screen to your App, and it needs to be a Scrollable screen. The scrollable screen will add a canvas and a datacard in it. You can cut and paste the entire Canvas control from that screen to another of your choice - OR leave it where it is - it is Global. You are not going to make it visible or do anything else with it in terms of controls, so where it is and what size it is will not be important.
NOW...the fun!!
There is an Update property in the Datacard. This is just like the one on a regular form datacard, but without all the form connections. You can put anything you want in there as long as it is a record.
We will use this property.
Let's set the stage - you have a Gallery on your screen and another on another screen as well as a Chart and a Combobox - all using the exact same data (i.e. formula). AND, let's say there is a Dropdown that depending on what is selected, will determine the data for all of those items properties.
This is annoying for many reasons: 1) if it is collection based, then you have to constantly, and in every place, need to recollect the data. 2) You have now duplicated formulas - if you need to change something, you have to do it in every place 3) it becomes a challenge to figure out what is where and where you might have forgotten to change something.
Now, back to our Update property. In there we put a formula such as :
{
MyItems:
Filter(someData, someColumn=Dropdown1.Selected.Value)
}
Your Update property is now giving us a record that has a table in it that is based on the Filter which is based on the Dropdown.
For our Galleries, we will simply replace the Items properties with : theDataCardName.Update.MyItems
Same for the combobox and the chart, etc.
Taking it a step further, we can add to this record even more things. So, let's say that our Galleries need slightly different data and our chart as well. First gallery wants just the Items, the second will have a calculated Sum of all the items, the Chart will want its data as Labels and Series, and our Combobox will have all the Items, PLUS we want to have an "All" as the first item in the list. We can do ALL of that in one place AND it will be dynamic based on the Dropdown (in this case).
So...Something like this:
With(_items: Filter(someData, someColumn=Dropdown1.Selected.Value)},
{
MyItems: _items,
Gallery2Items : AddColumns(_items, "someSum", Sum(_items, SomeValueColumn),
ChartItems: AddColumns(GroupBy(_items, "someLabelColumn", "_recs"), "seriesValue", Sum(_recs, someValue))
ComboboxItems: ForAll(Sequence(CountRows(_items)+1, 0), {Item: If(Value=0, "All", Last(FirstN(_items, Value)).someColumnforCombobox)})
}
)
In the above we just got all of the items tables for 4 controls ALL in one place and all based on the Dropdown in our app.
No collections needed and we don't have to do anything to instantiate this formula to evaluate and have the correct values (no Onxxx actions, no behavioral actions, etc.) It all just changes dynamically based on our Dropdown.
Again, this method works great and the sky is the limit on what you put in to these. Best part is that your formulas are all in one place and you completely cut out SO many extra formulas that you would normally need to make the above happen in other ways.
I do have a video and post coming out on this topic, but I am backlogged on these at the moment...so, the above is kind of a sneak-peek at what that will be like.
I hope this is helpful for you.