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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / "Incompatible Types fo...
Power Apps
Answered

"Incompatible Types for Comparison" Error in PowerApps While Using ForAll

(0) ShareShare
ReportReport
Posted on by 4
 Hi, I’m using a SharePoint list as a data source in my Power App, which includes a text column named "Team". I want to create a collection for use in a pie chart and am using the following formula:
ClearCollect(
    TeamCollection,
    ForAll(
        ["Safety & Security", "Control & Software", "Engineering Management", "Electrical & Electronics", "Systems"],  // List of team names
        {
            Team: ThisRecord,  // Current team name
            Count: CountRows(
                Filter(
                    'Form Answers',
                    Team = ThisRecord  // Compare the text column's value
                )
            )
        }
    )
);
 
However, I’m encountering the error: "Incompatible types for comparison. These types can't be compared: Text, Record."
The error appears on the = in the Filter function. I tried appending .Value to ThisRecord, but that results in a "Name not found" error.
Could someone help me understand how to resolve this issue?
Categories:
  • Verified answer
    Rayon Robert Profile Picture
    20 on at
     
    I tried re-creating your inputs for the required output.
    Below is the snip of the 'Form Answers' where I have 'Control Software' value containing 2 entries (for instance).
     
    In order to collect per your requirement, I have updated the below code where the Value from your 'Form Answers' - Team and Count are used to calculate the required.
    ClearCollect(
        TeamCollection,
        ForAll(
            ["Safety & Security", "Control & Software", "Engineering Management", "Electrical & Electronics", "Systems"], // List of team names
            {
                Team: Value, // Current team name
                Count: CountRows(
                    Filter(
                        colFormAnswers,
                        Team = Value // Compare the "Team" column's value in the data source
                    )
                )
            }
        )
    );
    The output is as below:
     
    I hope this helps.

    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.
  • CU07121457-0 Profile Picture
    4 on at
    Hi ,
    This works perfect as i wanted . Thank you so much.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard