cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to group by Month and Number of Visits per User

How can I group my line table to show the values grouped by month, but filtered by user logged in 

I have a PowerApp for Medical Service, they want to see in the app the number of visits that an employee has had during the year

I made this sample but the values are not grouped and I cannot filter by employee numberimagen_2021-02-26_160723.png

I have a colum that get the Month and another that add a 1 each time a form is submited this is how I track number of visits 
when the employee log-in in the app he has to use his employee number

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@EC_1,

Based on the issue that you mentioned, do you want to GroupBy the Month and Visitor based on the employee number?

Could you please share a bit more about the your data source?

I have a test on my side, a SP list named 'AMedE', 'Month', 'Mes_Visit', 'ENumber' are all Text columns.

I am not sure how you determine your employee number, in my scenario, I just assign it a simple code.

Create an app generated directly based on the SP list 'AMedE' so that I get three screens:

Browse Screen with a Gallery to display all the data

Detail Screen with a Display Form to display detailed information

Edit Screen with an Edit Form to create/edit data and submit data

I just set the Default property of the TextInput corresponding to the 'Mes_Visit' as "1".

1). Add a Dropdown 

set Items property:

Distinct(AMedE,ENumber)

set OnChange property:

ClearCollect(
    AME,
    AddColumns(
        GroupBy(
            Filter(AMedE,ENumber = Dropdown1.Selected.Result),
            "Month","GMonth"),
        "VisitN",CountRows(GMonth))
)

2). Inset a Line chart and set the Items property:

AME

2021-02-27-01.png

Regards,

Qi

 

Best Regards,
Qi

View solution in original post

1 REPLY 1
v-qiaqi-msft
Community Support
Community Support

Hi@EC_1,

Based on the issue that you mentioned, do you want to GroupBy the Month and Visitor based on the employee number?

Could you please share a bit more about the your data source?

I have a test on my side, a SP list named 'AMedE', 'Month', 'Mes_Visit', 'ENumber' are all Text columns.

I am not sure how you determine your employee number, in my scenario, I just assign it a simple code.

Create an app generated directly based on the SP list 'AMedE' so that I get three screens:

Browse Screen with a Gallery to display all the data

Detail Screen with a Display Form to display detailed information

Edit Screen with an Edit Form to create/edit data and submit data

I just set the Default property of the TextInput corresponding to the 'Mes_Visit' as "1".

1). Add a Dropdown 

set Items property:

Distinct(AMedE,ENumber)

set OnChange property:

ClearCollect(
    AME,
    AddColumns(
        GroupBy(
            Filter(AMedE,ENumber = Dropdown1.Selected.Result),
            "Month","GMonth"),
        "VisitN",CountRows(GMonth))
)

2). Inset a Line chart and set the Items property:

AME

2021-02-27-01.png

Regards,

Qi

 

Best Regards,
Qi

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,346)