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

Adding Calculated Columns to Static Table

Hi,

 

I have a table imported from an excel spreadsheet to which I want to add three columns.

 

The issue I'm having is that the third column is calculated off the other two.

 

When I try to add them all in the Items formula using AddColumns I can't get the third to access the first two as they dont' exist yet (at least that's what I think is happening).

 

Is there a way to add columns outside of Items?

 

 

Cheers

 

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Adding Calculated Columns to Static Table

Hi @Lewkir,

Please try creating a collection from your static datasource and then add the calculated columns. You should be able to display the results in a gallery or datatable as well as shaping the collection by filtering, sorting, renaming columns, etc. The main advantages are that you can create collections from very large datasources, all functions will work regardless of delegation, and they will be lightning fast.

The disadvantage is that you won’t be able to save them unless you create another datasource to save them to.

Highlighted
Helper III
Helper III

Re: Adding Calculated Columns to Static Table

Hi Drrickryp, Sorry I'm still fairly new to powerapps. Where would I actually type the code? I'm guessing you mean use the collect function as described here: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearc... but I'm uncertain where I would write this. Thanks for the response.
Highlighted
Super User III
Super User III

Re: Adding Calculated Columns to Static Table

You can do it with th OnSelect property of a button or in the OnVisible property of the screen containing the gallery. The syntax is

ClearCollect(colDatasource, Yourdatasource)

The Items property of the datatable or gallery would be  

AddColumns(colDatasource,”formulaname”,calculation,”formulaname2”,calculation2,etc.)
Highlighted
Helper III
Helper III

Re: Adding Calculated Columns to Static Table

Thanks for the help, Drrickryp, unfortunately I'm not sure this will fully work with what I'm trying to do as I need to reference items in a gallery in one of the calculations without it being prompted by the user. useful info to know though which might come in handy in the future. cheers

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,276)