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 / Graph /Chart (count)
Power Apps
Answered

Graph /Chart (count)

(0) ShareShare
ReportReport
Posted on by 905

Hello,

 

In my Sharepoint list I have a field Created. This field contains a date record of creation.

I tried to create a line chart that would have properties like that:

Daily amount of Created record in a cumulative way.

 

So for example it will look a bit like that:

 

Elitezone_0-1600869915709.png

 

I cannot use PowerBI as my organisation got no licenses.

Categories:
I have the same question (0)
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi ,

    You can use the Charts in PowerApp Also. See the Screen Shot. for reference.

    VijayTailor_0-1600887580911.png

     

    More details regarding how to use then have a look into the video URL mentioned below. 
    https://www.youtube.com/watch?v=b8iz1ar1I4E

    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."


  • Elitezone Profile Picture
    905 on at

    I know that I can use this. But I want to count total amount of records 'Date of Creation' on X, and show amount of records daily with Y.

    I do not know how to count and sort date of creation.

     

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Elitezone ,

     

    Do you want to use a Line-Chart to shown the cumulate records in a period or from the beginning? How many records are there in your SP list? How long would you like the period to be?

     

    I assume that you want to display the whole records cumulated from the beginning till now. I made a test on my side.

     

    I put below formulas on the Chart Screen’s OnVisible:

     

     

    ClearCollect(
     RecordCount,
     DropColumns(
     AddColumns(
     GroupBy(
     AddColumns(
     SortByColumns(
     ListName,
     "Created",
     Ascending
     ),
     "dates",
     Text(
     ThisRecord.Created,
     DateTimeFormat.ShortDate
     )
     ),
     "dates",
     "GroupDate"
     ),
     "counts",
     CountRows(GroupDate)
     ),
     "GroupDate"
     )
    );
    Clear(ttRecord);
    ForAll(
     RecordCount,
     Collect(
     ttRecord,
     Patch(
     Last(
     FirstN(
     RecordCount,
     CountRows(ttRecord) + 1
     )
     ),
     {
     ttCount: Sum(
     ttRecord,
     counts
     )
     }
     )
     )
    );
    ClearCollect(
     ttCounts,
     DropColumns(
     AddColumns(
     ttRecord,
     "tCount",
     Sum(
     counts,
     ttCount
     )
     ),
     "ttCount",
     "counts"
     )
    )

     

     


    Let me explain the formulas.

     

    First I created a collection “RecordCount”, with the columns of dates and number of records belonging to each date. I sort the data source by the column so the records sort ascending of dates and formatted the “Created” column to a date only format “DateTimeFormat.ShortDate” in the “dates” column, then group by “dates” column to get a table with a column “counts” to CountRows of the grouped column “GroupDate”, then drop the colomns to get a table only contains the dates and number or records in each date.

     

    Next step I created a new collection “ttRecord” to add a column “ttCount” to retrieve the result of each record’s “count” plus the previous record’s.

     

    But since the column “ttCount” with fields in wrong places (one line down of the proper), I have to create a third collection to sum each records “counts” and “ttCount” field. At last, using DropColumns to modify the collection into a table with two columns “dates” and “tCount”.

     

    Below is my test chart screen, the Line-Chart's Items property is set to ttCounts.

     35.jpg

    Since a large amount of counting would trigger when the screen shows up (records lists are mostly large data sets), I assume there would be a bad performance. The best way is using Power BI but I wonder is there any other method such as with the SP list “Use calculated value” function?

     

    Hope this helps.

     

    Best regards,
    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution  to help the other members find it.
  • Elitezone Profile Picture
    905 on at

    @v-jefferni 

    Holy moly...

     

    I can create such a chart in 10 min in Power BI. Here I wouldn't make it in a week!

     

    My errors:

    RecordCount name not recognized

    Function ClearCollect got invalid arguments

    Unexptected signs. Signs in formula are used in an unexepected way.

     

    ClearCollect(
     RecordCount;
     DropColumns(
     AddColumns(
     GroupBy(
     AddColumns(
     SortByColumns(
     IdeaBox_1;
     "Created";
     Ascending
     );
     "dates";
     Text(
     ThisRecord.Created;
     DateTimeFormat.ShortDate
     )
     );
     "dates";
     "GroupDate"
     );
     "counts";
     CountRows(GroupDate)
     );
     "GroupDate"
     )
    );
    Clear(ttRecord);
    ForAll(
     RecordCount;
     Collect(
     ttRecord;
     Patch(
     Last(
     FirstN(
     RecordCount;
     CountRows(ttRecord) + 1
     )
     );
     {
     ttCount: Sum(
     ttRecord;
     counts
     )
     }
     )
     )
    );
    ClearCollect(
     ttCounts;
     DropColumns(
     AddColumns(
     ttRecord;
     "tCount";
     Sum(
     counts;
     ttCount
     )
     );
     "ttCount";
     "counts"
     )
    )

     

    What to do with Items in Chart? What should I provide there?

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Elitezone ,

     

    Since the formulas are set on the OnVisible of the screen, you'd better change to another screen then get back, or the first collecting would not be created.

     

    Chat Items is the "ttCounts" which created in the last part of OnVisible formulas.

     

    Regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Elitezone Profile Picture
    905 on at

    @v-jefferni 

    I created another screen that is leading back to this screen but the error still persist.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Elitezone ,

     

    May I have more details about the error prompts on your screen?

    Better be a screenshot.

     

    Regards,

    Community Support Team _ Jeffer Ni

  • Elitezone Profile Picture
    905 on at

    Elitezone_0-1601019671708.png

     

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Elitezone

     

    Considering your location, it should be the ";;" follows each formula.

     

    Regards,

    Community Support Team _ Jeffer Ni

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 538

#2
WarrenBelz Profile Picture

WarrenBelz 420 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard