cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dhinesh28R
Helper V
Helper V

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 III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

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 III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

HI @RandyHayes,

I created column for CreatorDepartmnt.

Now its filtering correct Data man.

 

Thanks,

Dhinesh

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (75,691)