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

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
TimRohr
Level 10

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
TimRohr
Level 10

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

Samurai89
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,171)