cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Filter Chart by Multiple Conditions

Hi,

 

I'm new to PowerApps, so please excuse me. I'm trying to display a chart based on two conditions: the month selected in a gallery (Gallery1), and the username selected from a drop-down list (DropdownUsers). I'm using 3 different data sources:

 

  • DropdownUsers - uses DataSource1 with Users column
  • Gallery1 - uses DataSource2 with MonthYear column
  • DataSource3 - contains the chart's data and has the same column names (MonthYear & Users) to link it to DataSource1 and DataSource2

 

I entered the following as the chart's Items function: 'Filter(DataSource3,MonthYear=Gallery1.Selected.MonthYear, UserName=DropdownUsers.Selected.Value)'. It does not show any errors, but it does not display any charts either.

 

Any help would be appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

Re: Filter Chart by Multiple Conditions

Without seeing your data or your screen, I would guess the problem is in this part:

 

UserName=DropdownUsers.Selected.Value

 

Depending on how you built your Dropdown, you might have other field options than 'Value.' Make sure you're getting the right one. To test if "DropdownUsers.Selected.Value" is getting you what you expect, assign the Value to a Context Variable and then set a label to have that variable as its text property. Make a selection in the dropdown, then see what the label shows you. If it looks like a UserName, try building the filter for the Chart manually...

 

If you take the gallery and the dropdown out of the mix, you can manually create the filter for the chart to default it to be one particular MonthYear for one particular user. Get the UserName of the chart you want to show and substitute it into the Filter() function. If you did the step, above, with the label to get the dropdown, you can copy and paste.

 

My guess is you are not properly returning the UserName from the dropdown.

 

If none of that helps, maybe you could post a screenshot of how your dropdown is constructed, or some data?

View solution in original post

2 REPLIES 2
Highlighted
Solution Sage
Solution Sage

Re: Filter Chart by Multiple Conditions

Without seeing your data or your screen, I would guess the problem is in this part:

 

UserName=DropdownUsers.Selected.Value

 

Depending on how you built your Dropdown, you might have other field options than 'Value.' Make sure you're getting the right one. To test if "DropdownUsers.Selected.Value" is getting you what you expect, assign the Value to a Context Variable and then set a label to have that variable as its text property. Make a selection in the dropdown, then see what the label shows you. If it looks like a UserName, try building the filter for the Chart manually...

 

If you take the gallery and the dropdown out of the mix, you can manually create the filter for the chart to default it to be one particular MonthYear for one particular user. Get the UserName of the chart you want to show and substitute it into the Filter() function. If you did the step, above, with the label to get the dropdown, you can copy and paste.

 

My guess is you are not properly returning the UserName from the dropdown.

 

If none of that helps, maybe you could post a screenshot of how your dropdown is constructed, or some data?

View solution in original post

Highlighted
Helper I
Helper I

Re: Filter Chart by Multiple Conditions

The issue wasn't with my formula - my data source wasn't configured correctly. I adjusted some of the columns and now it works fine. Thank you for your help!

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,713)