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

Distinct on Filter dropdown

Hi Everyone,

 

Is it possible to do a distinct formula on this filter dropdown? 

2.JPG

 

Currently, the filtered dropdown load data from dropdown 1.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Atran7785 

So first, if the Items property of Dropdown3 is as you say, then, as mentioned, there would be no .Value to use as the Distinct function returns a table with a Result column.

So, the formula would be:

 Distinct(Filter('Service Catalog', Category=Dropdown3.Selected.Result), Department)

 

But, is Department then the name of the column you are displaying in your dropdown you're trying to change?  Make sure that has the correct column name.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

6 REPLIES 6
RandyHayes
Super User
Super User

@Atran7785 

Yes, you can use the Distinct function to surround the current Items property that you have.

You didn't mention any Items formula in your post, so I cannot provide a specific, but that is generally what you need to do.

i.e  Distinct(currentItemsProperty, columnName)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Atran7785
Helper I
Helper I

Hi @RandyHayes ,

 

Thanks for the reply. Here is my formula now:

 

Filter('Service Catalog',Category=Dropdown3.SelectedText.Value)

RandyHayes
Super User
Super User

@Atran7785 

So first, you should get rid of the .SelectedText property you are using as that has been deprecated.  

Also, you will need to keep in mind that you are currently using a straight Filter function on the dropdown items, so your dropdown will have ALL columns of the resultant records available to you.  

You seem concerned over the values you have displayed in your original image - which look like departments.

So, I will make the assumption there is some "Department" column in your data.

 

With that in mind, your formula should be:

   Distinct(Filter('Service Catalog', Category=Dropdown3.Selected.Value), Department)

 

Three assumptions in the above: 

1) Your Dropdown3 Items formula provides only values - if not, then change .Value in the above to the correct column name of your Items property for Dropdown3 (if you are not sure, please provide your Dropdown3 Items property formula).

2) You have a Department column in your service catalog datasource.  If not, then change to the one you have.

3) There are no other controls in your app that depend on any other column beside the department from the dropdown that this formula is for.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Atran7785
Helper I
Helper I

Hi @RandyHayes 

 

I got 2 errors putting that formula in.
Name isn't valid. This identifier isn't recognized.

 

Incompatible  types for comparison. These types can't be compared: Text, Error

 

Atran7785_0-1638212968387.png

 

Dropdown 3 Formula is:

SortByColumns(Distinct('Service Catalog',Category),"Result")

 

RandyHayes
Super User
Super User

@Atran7785 

So first, if the Items property of Dropdown3 is as you say, then, as mentioned, there would be no .Value to use as the Distinct function returns a table with a Result column.

So, the formula would be:

 Distinct(Filter('Service Catalog', Category=Dropdown3.Selected.Result), Department)

 

But, is Department then the name of the column you are displaying in your dropdown you're trying to change?  Make sure that has the correct column name.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Atran7785
Helper I
Helper I

thanks! @RandyHayes 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,544)