web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Grouping by and counti...
Power Apps
Answered

Grouping by and counting values in Lookup Columns

(1) ShareShare
ReportReport
Posted on by 40
Hi, 
 
I have a table 'Application Reviews' with columns 'Application ID' and 'Reviewer'. 'Application ID' is a lookup column to table 'Applications', and 'Reviewer' is a lookup column to table 'Reviewers'.  I'm trying to create a text box in my canvas app that displays the number of applications that have been reviewed by more than 1 reviewer. I've tried the following below, but I get an error that 'Application ID' "expects a text, numeric, boolean, or date/time value".  
 
Really appreciate any help!
 
CountIf(
AddColumns(
GroupBy('Application Reviews', 'Application ID', GroupedAppIDs), 
DistinctReviewers, 
CountRows(
Distinct(GroupedAppIDs, Reviewer)
)
), 
DistinctReviewers > 1
)
 
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,075 Most Valuable Professional on at
    You need to add a column for the lookup fields as below (I assume you are using SharePoint here)
    CountIf(
       AddColumns(
          GroupBy(
             AddColumns(
                'Application Reviews', 
                AppID,
                'Application ID'.Value,
                Review,
                Reviewer.Value
             ),
             AppID, 
             GroupedAppIDs
          ), 
          DistinctReviewers, 
          CountRows(
             Distinct(
                GroupedAppIDs, 
                Review
             )
          )
       ), 
       DistinctReviewers > 1
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee
  • ben_E_556 Profile Picture
    40 on at
    Got it to work using Warren's reply and changing the .Value to .application_id and .reviewer. Thanks!
     
    CountIf(
       AddColumns(
          GroupBy(
             AddColumns(
                'Application Reviews', 
                AppID,
                'Application ID'.application_id,
                Review,
                Reviewer.reviewer
             ),
             AppID, 
             GroupedAppIDs
          ), 
          DistinctReviewers, 
          CountRows(
             Distinct(
                GroupedAppIDs, 
                Review
             )
          )
       ), 
       DistinctReviewers > 1
    )

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard