cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
valuehr
Helper I
Helper I

Create unique expense category name for subtotal section in expense report app

I have created an expense report app that allows users to add new expenses (Screen2) and review existing expenses (Screen3), which loads from loaddata from a collection (SaveAddExpense). 

 

Screen3, Gallery1 fields include:

name

department

expense category

expense date

gl code

expense amount

 

I have successfully provided a subtotal formula by expense category:

Sum(Filter(SaveAddExpense,ExpCat=ThisItem.ExpCat),Amount)

 

However, I cannot figure out how to provide the corresponding expense category name for each subtotal amount. Since the collection could have multiple expense categories with the same name, I need the formula to give me the unique expense category that corresponds to the subtotal expense amount. The fields from screen 3 vary based on what the user initially selects from screen1, which has a drop down menu of name, department, and expense category specific to their department, since they vary.

 

The result in Screen3, Gallery2, should be:

Meals & Entertainment - $125.00

Office Supplies - $35.00

etc.

Expense Category unique name - subtotal $$

 

After I have the subtotals by expense category in place, I'll provide a grand total at the bottom of the screen. I don't need help with this one, since I've already done it.

 

Thanks for your help.

 

collection.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

I actually decided to go another route.  I decided to use the Groupby and AddColumns functions, which creates two additional collections, and then insert a gallery that pulls from the 3rd created collection.

 

It works perfectly this way.

 

Thanks for responding.

View solution in original post

2 REPLIES 2
v-micsh-msft
Community Support
Community Support

Hi @valuehr,

 

So the issue here is the Name of the expense category can't be located?

Could we add another filter condition to narrow down it?

Something like:

Sum(Filter(SaveAddExpense,ExpCat=ThisItem.ExpCat, Department=SomeControl.value),Amount)

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I actually decided to go another route.  I decided to use the Groupby and AddColumns functions, which creates two additional collections, and then insert a gallery that pulls from the 3rd created collection.

 

It works perfectly this way.

 

Thanks for responding.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,173)