web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Anzahl Datensätze zählen
Power Apps
Answered

Anzahl Datensätze zählen

(0) ShareShare
ReportReport
Posted on by 169

Hallo!
Im Anhang seht ihr einen Screen, in dem ich über die Eingabe eines Datums in der Suchzeile die Datensätze, die diesem Datum entsprechen, anzeigen lasse.
Im Textfeld im obersten Rand soll die Anzahl der gefilterten Datensätze stehen

DAs wollte ich mit 

CountRows(BrowseGallery1_1.AllItems)

machen, gibt aber nur einen Fehler aus!

Im rot eingekreisten Feld soll das Ergebnis von 4/Anzahl der gefilterten Datensätze stehen.

WEr kann helfen!!!!

Was mache ich falsch?

Unbenannt.png

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @chrisegger ,

    Where are you putting that formula - it needs to be outside the gallery.

  • chrisegger Profile Picture
    169 on at

    IT is outside the gallery

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    @chrisegger ,

    Then what errors are you getting - it should simply count the rows of the gallery. Bear in mind that if your gallery is filtered directly off a list, you will only get 100 records at a time as you scroll down.

  • chrisegger Profile Picture
    169 on at

    chrisegger_0-1646290640220.png

    im Textinput1 Feld soll die Zahl der aufgelisteten Datensätze durch die Formel CountRows(BrowseGallery1_1.AllItems)

    stehen.

     

    chrisegger_1-1646290821065.png

    Im Labelfeld soll die Zahl 4 durch die Anzahl der ermittelten Datensätze dividiert werden und diese Zahl als Euro Betrag ausgegeben werden.

    Im Labelfeld zum "Gesamtpreis:" sollen diese 2 Eurobeträge addiert werden.

    Was läuft da falsch ....

     

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    @chrisegger ,

    English please (I am from Australia). I responded to a question about counting the rows of a gallery - I am not sure how your latest response relates to that (maybe the Google Translate did not do good job.

  • chrisegger Profile Picture
    169 on at

    OK WarrenBelz, and I'm from Austria 😀
    So again my problem:
    I wanna build a app for teacher in my school, wich want to order a pizza.
    There is a delivery fee about 4 € and it should be divided to all people wich ordered a pizza, identified by the date.
    So I got a filter by date. The Gallery will show all the people wich ordered that day. So I have to count the datas in the Gallery and divide.
    But it doesnt work
    When i got to know how many money each of the people have to pay the proportional delivery fee, I want to add it to the price of the pizza. So I  know how much each of them have to pay ...
    Could you help me???

     

    Thanks a lot and greetings to Australia

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @chrisegger ,

    Your code

    CountRows(BrowseGallery1_1.AllItems)

    if placed in a control outside the gallery will return the number of rows in that gallery. It seems however that you are doing a calculation inside the gallery with the result (the .80 you have circled), which creates the circular reference I mentioned. You need a "calculate" button doing something like

    UpdateContext({varCount:CountRows(BrowseGallery1.AllItems)})

    then your calculation in the gallery will be

    Round(PizzaPriceField / varCount , 2)

     

    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.

    Visit my blog Practical Power Apps

  • chrisegger Profile Picture
    169 on at

    Sorry but this doesnt work!

    So I changed the form a little bit!

    The calculation of the delivery fee works fine

    chrisegger_0-1646370868954.png

    chrisegger_1-1646370981727.png

     

    I did it with the formula:
    Text(4/CountRows(BrowseGallery1_1.AllItems);"[$-de]#,00")

    in Label14 outside the gallery

     

    The "Summe Preis" in the gallery I did with:

    Text(Sum(ThisItem.Pizzapreis;ThisItem.Getraenkepreis);"[$-de]#,00")& " €"

    in label11 inside the gallery

     

    but I can't add this two together in the gallery!
    its tricky

     

     

     

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    HI @chrisegger ,

    Back to the Circular Reference again . . . you cannot have a calculation inside the gallery dependent (even by a "chain" of other calculations) dependent on a variable attribute of the gallery (such as CountRows). You need to set a Variable to "break the chain" (as it becomes a static value until set again) and then base your calculation on the Variable.

     

    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.

    Visit my blog Practical Power Apps

  • chrisegger Profile Picture
    169 on at

    How to Do setting a veriable and dhere? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard