How could I add multiple columns at once in PowerApps

Hi I am having the data in sharepoint like

Title ID
S1 101
S1 102
S2 103
S3 104
S3 105

Now I have to create a piechart in PowerApps Showing the Percentage of Each title.

So, I am creating a new column using AddCoulmn(GroupBy,"Title", "Grouped"), "Titles", CountRows(Grouped))

Now I want to create another Column with the distinct titles and its percentage with reference to the ID.

How can I do that?

1 Answer

The AddColumns function can add multiple columns at once. For example, the expression below can be used to add a percentage in addition to the number of titles in the grouping that you have.

With( { totalCount: CountRows(dataSource) }, AddColumns( GroupBy(dataSource, "Title", "Grouped"), "Titles", CountRows(Grouped), "TitlePercent", 100.0 * CountRows(Grouped) / totalCount)) 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like