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 / Doing countrows inside...
Power Apps
Answered

Doing countrows inside ForAll allways 1

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello good people of Power Community.

 

It's getting late, and I have used way to much time allready, so hope someone can help me out. 


Im looking for a clever way to count the number of reports and display it as a piechart

I have a category list with 4 categories (but it can be as many as the user like)

I have a report list with HSEQ reports that has one of the category listetd i Category list.

 

I tried as follow:

 

 

Clear(_dataResult);;

ClearCollect(
 _dataKlassifiseringer;
 LVL_HSEQ_Klassifisering
);;

ClearCollect(
 _dataRapporter;
 LVL_Kvalitet_Forbedring
);;

ForAll(
 _dataKlassifiseringer;
 Collect(
 _dataResult;
 {
 ID:ID;
 Title:Title;
 Antall: CountIf(LVL_Kvalitet_Forbedring;klassifiseringsID=ID)
 
 }
 )
)

 

 

I have tried CountRows(Filter(....)), with same result, allways 1 for each item. The result is as follow:

TurboTape_0-1610037614761.png

 

Column 3 is the Antall from code above. Column 4 is coded in a textbox inside the gallery and give me the correct result I want, but its useless when its calculated inside the gallery. All these codes should run in the background onVisible or onStart and display a graph on the dashbord for the user. 

 

Any help, tip or alternative methods is greatly appreciated. 

 

Best Regards

Tommy



Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @TurboTape 

    So you mention that it is useless in the Gallery...why is that?

    You can have your graph get its data from that Gallery if you already have the values there that you want.

     

    In other words, there is no need for all of these collections if you already have the values you want in your Gallery...the Gallery is already a table.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi RandyHayes

     

    Thanks for reply :).

     

    That was my second plan, but they are not available as series in the pie chart. Maybe I'm doing something wrong here?:

    TurboTape_0-1610092047257.png


    I tried textbox and input box, but they are not recognised. Maybe I can patch the gallery to a table or something.

    What I would like to know is, if it is impossible to to anything like I initially tried to or not. If its not possible I can use time to try to make a gallery and patch it to a collection in the background. 

     

    Best regards

    Tommy

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @TurboTape 

    You will need to shape your data in the Items property.

    Something like this:

    ShowColumns(
     AddColumns(
     Gallery22.AllItems,
     "_antall", Value(theNameOfTheTextBoxInYourGallery.Text)
     ),
     "Title",
     "_antall"
    )
    

    This will provide a table of records with a Title (for Labels) and a _antall (for Series) to the Items of your pie chart.

     

     

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 400 Most Valuable Professional

#2
11manish Profile Picture

11manish 141 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard