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

Sum text value

Hello everybody,

 

I want to sum certain text values from my gallery.
Who can help me correct the formula?

 

sum.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver I
Resolver I

Re: Sum text value

Hi,

 

Also, the text field needs to be used for the Subtitle System.

CountRows(Filter(GalleryEva.AllItems; SubtitleSystem.Text = "Schmierung"))

 

Hope this helps,

Alex 

View solution in original post

10 REPLIES 10
Highlighted
Super User III
Super User III

Re: Sum text value

What is your code on the items of your Gallery?

Meanwhile try:

Sum(Gallery1.AllItems,de-DE)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted
Resolver I
Resolver I

Re: Sum text value

Hi,

 

Formulas do not work on DataTables directly, you will have to use to source of the table such as a collection or connector.

 

Hence this should look similar to:

Sum(Filter(<source>, <column>="Schmierung"), <expressions>)

Where the items in <> need to be replaced with the correct values.

 

Hope this helps,

Alex 

Highlighted
Super User III
Super User III

Re: Sum text value

@Robertjde 

You cannot SUM a text value, however you can COUNT them.  To COUNT the number of instances where Schmierung appears use this code and replace your_datasource_name and ColumnName with your own values.

 

CountRows(Filter(your_datasource_name, ColumnName="Schmierung"))

 

Do use Gallery1.AllItems as the datasource as it will often return the wrong results.  Use the actual datasource instead (SharePoint, SQL, CDS, etc.)!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Helper IV
Helper IV

Re: Sum text value

@mdevaney @BakerAlex @eka24 

What I did not mention is that I use the dropdown box to filter the gallery by column 2 and then want to add up this result in the gallery ...
how often was lubrication?
how often was centerling?
how often was SOC, HTR; HTC?

 

Dropdownbox Items:

Distinct('AM & PM Optimierungen';Anlagenteil).Result

Gallery5 Items:

Filter('AM & PM Optimierungen';StartsWith(Anlagenteil;Dropdown7.Selected.Result))

Label (Subtitle System) in the Gallery5:

ThisItem.System

 

I just want to sum the filtered different results for tables column "System" in multiple labels.

Highlighted
Super User III
Super User III

Re: Sum text value

@Robertjde 

Sorry, I still do not understand.  Where is the number you wish to SUM?  I do not see any numbers inside your dataset.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Helper IV
Helper IV

Re: Sum text value

 

@mdevaney @BakerAlex @eka24 

 

i want to count the texts.
how often does the word Schmierung appear (red)
how often does the word Centerlining appear (blue)
how often does the word SOC, HTC, HTR appear (black)

 

GalleryEva.PNG

Highlighted
Resolver I
Resolver I

Re: Sum text value

Hi,

 

In that case you want to use CountRows with a filter on the source.

CountRows(Filter(<Source>, System = "Schmierung"))
CountRows(Filter(<Source>, System = "Centerlining"))

 

Alternatively, if you need it dynamic, you can use grouping (as below) and add it to a gallery to be displayed.

AddColumns(
    GroupBy(<Source>, "System", "DATA"),
    "Count",
    CountRows(DATA))

 

Note that the <Source> will need to be replaced by the source of the calculation (the table).

 

Hope this helps,

Alex

Highlighted
Helper IV
Helper IV

Re: Sum text value

@BakerAlex 

 

I filter my gallery by the column "Bereich". Then I would like to count how often the systems occur.


When I use your formula, I count the results from the complet entire database.
i tried to rearrange your formula so that i only count the systems displayed in the gallery, but it doesn't work.

 

CountRows(Filter(GalleryEva.AllItems);SubtitleSystem = "Schmierung")
Highlighted
Resolver I
Resolver I

Re: Sum text value

Hi,

 

The filter end bracket should be at the end:

CountRows(Filter(GalleryEva.AllItems; SubtitleSystem = "Schmierung"))

 

Hope this helps,

Alex 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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 (843)