Skip to main content

Notifications

Community site session details

Community site session details

Session Id : HR8de8QIwvywVlyUqLrCsg
Power Apps - Building Power Apps
Answered

How to filter a text label similar to how a gallery is filtered

Like (0) ShareShare
ReportReport
Posted on 13 Jul 2022 18:30:49 by 101

Hello,

So I am already pretty far down the line with this app. One of the functions I have set up is to only display the items created by the user logged in. So basically, I have a hidden text label that is set to User().FullName using Office365 connections. From there, I connect this to our employee database to pull job titles, departments, etc. Anyways, filtering my gallery is relatively easy. I have a few extra components that include filters and variables so please ignore those, what I am referrring to is in red.

Filter('Expense Records', SubmittedBy = EmployeeID.Text, Or(varFilter ="All", Status = varFilter))

Basically says that when a form is submitted ^, see if the hidden label on the main page matches the submitted code saved by the form and then display only these values. Simple right?

Well, at the top of my page I want a summary, that lets a user view the counts and totals of their expenses. Here is the function for the Pending one, the only differences are the statuses in "" for the others.

"$ " & Round(If(Sum(Filter('Expense Records', Status = "Pending"), Amount) = Blank(), Blank(), "$ " & Sum(Filter('Expense Records', Status = "Pending"), Amount)), 2)

What I am having trouble with is incorporating the Filter(Source, ID = ID.text) type logic into this already long formula. Right now, these totals sum EVERYONEs expense, but I just want it to pull in the amounts from the user currently logged in, similar to my gallery.

Thanks!

Categories:
  • water-guy-5 Profile Picture
    101 on 14 Jul 2022 at 21:19:40
    Re: How to filter a text label similar to how a gallery is filtered

    @WarrenBelz whoops sorry about that. I was getting confused by the wItem part of the message you sent

  • WarrenBelz Profile Picture
    146,508 Most Valuable Professional on 14 Jul 2022 at 20:10:31
    Re: How to filter a text label similar to how a gallery is filtered

    HI @water-guy-5 ,

    If you have a look at what I posted, it is exactly the same, but you do not have to type in the filter twice.

  • Verified answer
    water-guy-5 Profile Picture
    101 on 14 Jul 2022 at 13:59:34
    Re: How to filter a text label similar to how a gallery is filtered

    Hey everyone, I figured it out. Turns out it was a lot easier than expected. I was trying to incorporate an AND function to my IF, but I instead just added "&&" with another parameter

    "$ " & Round(If(Sum(Filter('Expense Records', Status = "Pending"), Amount) = Blank(), Blank(), "$ " & Sum(Filter('Expense Records', Status = "Pending"), Amount)), 2)

    with the change is

    "$ " & Round(If(Sum(Filter('Expense Records', Status = "Pending" && SubmittedBy = EmployeeID.Text), Amount) = Blank(), Blank(), "$ " & Sum(Filter('Expense Records', Status = "Pending" && SubmittedBy = EmployeeID.Text), Amount)), 2)

  • Verified answer
    WarrenBelz Profile Picture
    146,508 Most Valuable Professional on 13 Jul 2022 at 22:32:43
    Re: How to filter a text label similar to how a gallery is filtered

    Hi @water-guy-5 ,

    Maybe something like this

    With(
     {
     wItem:
     Filter(
     'Expense Records', 
     Status = "Pending" &&
     SubmittedBy = EmployeeID.Text
     )
     },
     Coalesce(
     wItem,
     "$" & 
     Round(
     Sum(
     wItem,
     Amount
     ),
     2
     )
     )
    ) 

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,440 Most Valuable Professional

Leaderboard
Loading started