cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sr12
Helper III
Helper III

Multiple Filters

Hello,

 

How can I filter multiple things at the same time? I have an excel table and would like to filter the data for the logged in user and count how many sick leaves did the user take. 

 

My code is: Set(getTotalSickLeaveForLoggedinUser,CountRows(Filter(Table1, User().Email = 'Created By'))); 

This code gets the total number of leaves for each user

CountRows(Filter(Table1, 'Leave Type'= "Sick Leave"))), and this gets the total sick leaves.

So how i cant i add both codes together in order to filter the sick leaves for each user

 

Thanks.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @sr12 ,

 

By using '&&' and function. 

  Set(getTotalSickLeaveForLoggedinUser,CountRows(Filter(Table1, User().Email = 'Created By' && YourLeaveTypeColumn="Sick leave"))); 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

WarrenBelz
Super User
Super User

Hi @sr12 ,

Try this - you will have to add the column name and value to match

Set(
   getTotalSickLeaveForLoggedinUser,
   CountRows(
      Filter(
         Table1, 
         'Created By'.Email = User().Email && 
         LeaveTypeColumn = "Sick"
      )
   )
)

 

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.

View solution in original post

5 REPLIES 5
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @sr12 ,

 

By using '&&' and function. 

  Set(getTotalSickLeaveForLoggedinUser,CountRows(Filter(Table1, User().Email = 'Created By' && YourLeaveTypeColumn="Sick leave"))); 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

WarrenBelz
Super User
Super User

Hi @sr12 ,

Try this - you will have to add the column name and value to match

Set(
   getTotalSickLeaveForLoggedinUser,
   CountRows(
      Filter(
         Table1, 
         'Created By'.Email = User().Email && 
         LeaveTypeColumn = "Sick"
      )
   )
)

 

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.

sr12
Helper III
Helper III

@WarrenBelz,

How can I show the variable value, which is the sick leave balance for example?

Hey @sr12 - Set the text property of label as 'getTotalSickLeaveForLoggedinUser' to show it in the screen.

Hi @Ashwin7104,

Thank you for your reply!

It worked.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,126)