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!
@WarrenBelz whoops sorry about that. I was getting confused by the wItem part of the message you sent
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.
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)
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