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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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

thanks! @RandyHayes 

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 (3,567)