cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dhinesh28R
Post Prodigy
Post Prodigy

Filter wrong data to Galery

Hi,

i filtered my gallaery based on month, year and department by dropdown.

 

this is my list,

createdDateCreatornamecreatorMailRecievermailRecieverNameDepartment
03-03-2021Sureshsuresh@test.comDani@test.comDaniJava
03-03-2021DaniDani@test.comsuresh@test.comSuresh.net

 

from this list i filter my data into gallery based on Month and Department

SureshJava1

 

This is a wrong result am getting while am selcting .net.

 

Am using follwing Formula ,
FirstN(SortByColumns(AddColumns(GroupBy(Filter(List,Month(CreatedDate) = Dropdown3_1.Selected.ID, Year(CreatedDate) =Dropdown6_1.Selected.ID && Department= Dropdown1.Selected.Value),"Creatorname","creatorMail","Details"),"Count",CountRows(Details)),"Count",Descending),5)

am using the above fomula for filtering data into my gallery

 

Is display wrong result instead of .net it showing java.

 

Is anything wrong in my formaul?

 

Thanks,

Dhinesh

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Dhinesh28R 

Your formula is essentially fine.  I would suggest the following just to boost performance a little:

SortByColumns(
    FirstN(
        AddColumns(
            GroupBy(
                Filter(List,
                    Month(CreatedDate) = Dropdown3_1.Selected.ID &&
                    Year(CreatedDate)= Dropdown6_1.Selected.ID && 
                    Department = Dropdown1.Selected.Value
                ),
                "Creatorname", "creatorMail", "Details"
            ),
            "Count", CountRows(Details)
        ), 
        5
    ),
    "Count", Descending
)

 

As for the wrong department, this is going to hinge on the Dropdown1 selection.  I would look over the items property of your dropdown and make sure you are filtering on the proper column of that selected item from the dropdown.

 

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!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@Dhinesh28R 

Your formula is essentially fine.  I would suggest the following just to boost performance a little:

SortByColumns(
    FirstN(
        AddColumns(
            GroupBy(
                Filter(List,
                    Month(CreatedDate) = Dropdown3_1.Selected.ID &&
                    Year(CreatedDate)= Dropdown6_1.Selected.ID && 
                    Department = Dropdown1.Selected.Value
                ),
                "Creatorname", "creatorMail", "Details"
            ),
            "Count", CountRows(Details)
        ), 
        5
    ),
    "Count", Descending
)

 

As for the wrong department, this is going to hinge on the Dropdown1 selection.  I would look over the items property of your dropdown and make sure you are filtering on the proper column of that selected item from the dropdown.

 

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!

Hi @RandyHayes ,

It's working fine man. but i want a Creatorname 's Department.

In list it stores RecieverName Department.

But actually i want a dropdown selction for Creator Department records stores in Gallery.

Is this Possible?

 

Thanks,

Dhinesh

RandyHayes
Super User
Super User

@Dhinesh28R 

So what is the relationship of creatorname and receivername to the department?

What is the items property of the dropdown?

_____________________________________________________________________________________
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!

HI @RandyHayes,

I created column for CreatorDepartmnt.

Now its filtering correct Data man.

 

Thanks,

Dhinesh

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,348)