cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Charlyvil
Level: Powered On

Complex Filter(Two list), grouping by date and graph

Hi everyone!

I've been thinking about a solution for two days and I haven't been able to solve it. I hope you can help me:

I have two tables like this:

stores

store

Section

ID

Date

Blue

Section 1

1

10/17/2019

Yellow

Section 1

2

10/17/2019

Blue

Section 2

3

11/17/2019

Blue

Section 1

4

10/17/2019

Pink

Section 1

5

12/12/2019

 

relationSells

IDProduct

productType

IDStore

1

1

1

2

1

1

3

3

1

1

1

4

2

2

5

2

2

4

 

In PowerApps y have two dropdown list:

dropDown1.Items = Distinct(Stores.store)
dropDown2.Items = I have a Filter to show available sections for that store

drops.png

So I need to filter the data(stores):

 

store

Section

ID

Date

Blue

Section 1

1

10/17/2019

Blue

Section 1

4

10/17/2019

 

Next I need to filter all ID’s (1 and 4) in relationSells:

IDProduct

productType

IDStore

1

1

1

2

1

1

3

3

1

2

2

4

 

After counting the 1,2,3,etc from productType:

productType

Count

1

2

2

1

3

1

 

And finally graph this data per month to report annually. (The date is getting from stores list):2019-10-22 23_21_08-Window.png

If you have a suggestion or solution I appreciate very much.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Complex Filter(Two list), grouping by date and graph

Hi @Charlyvil ,

I've made a similar test based on your description.

Here's my test for your reference:

1)

dropDown1.Items = Distinct(Stores.store)
dropDown2.Items = I have a Filter to show available sections for that store 

 set drop down1's Items:

Distinct(stores,store)

 set drop down2's Items:

Distinct(Filter(stores,store=Dropdown1.Selected.Result),Section)

 

2)filter the data(stores):

set the data table's Items:

Filter(stores,store=Dropdown1.Selected.Result,Section=Dropdown2.Selected.Result)

 

3) filter all ID’s (1 and 4) in relationSells:

set the data table's Items:

Filter(relationSells,IDStore in Filter(stores,store=Dropdown1.Selected.Result,Section=Dropdown2.Selected.Result).ID)

4) coun the 1,2,3,etc from productType:

set the data table's Items:

AddColumns(GroupBy(Filter(relationSells,IDStore in Filter(stores,store=Dropdown1.Selected.Result,Section=Dropdown2.Selected.Result).ID),
"productType","sametype"),
"Count",CountRows(sametype))

5) graph this to column chart 

set the columnchart's Items:

AddColumns(GroupBy(Filter(relationSells,IDStore in Filter(stores,store=Dropdown1.Selected.Result,Section=Dropdown2.Selected.Result).ID),
"productType","sametype"),
"Count",CountRows(sametype))

1024.PNG

 

However, your last demands "graph this data per month to report annually", I think this step need use flow. In PowerApps, it will not generate graph automatically per month.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Complex Filter(Two list), grouping by date and graph

Hi @Charlyvil ,

I've made a similar test based on your description.

Here's my test for your reference:

1)

dropDown1.Items = Distinct(Stores.store)
dropDown2.Items = I have a Filter to show available sections for that store 

 set drop down1's Items:

Distinct(stores,store)

 set drop down2's Items:

Distinct(Filter(stores,store=Dropdown1.Selected.Result),Section)

 

2)filter the data(stores):

set the data table's Items:

Filter(stores,store=Dropdown1.Selected.Result,Section=Dropdown2.Selected.Result)

 

3) filter all ID’s (1 and 4) in relationSells:

set the data table's Items:

Filter(relationSells,IDStore in Filter(stores,store=Dropdown1.Selected.Result,Section=Dropdown2.Selected.Result).ID)

4) coun the 1,2,3,etc from productType:

set the data table's Items:

AddColumns(GroupBy(Filter(relationSells,IDStore in Filter(stores,store=Dropdown1.Selected.Result,Section=Dropdown2.Selected.Result).ID),
"productType","sametype"),
"Count",CountRows(sametype))

5) graph this to column chart 

set the columnchart's Items:

AddColumns(GroupBy(Filter(relationSells,IDStore in Filter(stores,store=Dropdown1.Selected.Result,Section=Dropdown2.Selected.Result).ID),
"productType","sametype"),
"Count",CountRows(sametype))

1024.PNG

 

However, your last demands "graph this data per month to report annually", I think this step need use flow. In PowerApps, it will not generate graph automatically per month.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Charlyvil
Level: Powered On

Re: Complex Filter(Two list), grouping by date and graph

Thank you so much Heart

 

You win pass to heaven. 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,068)