Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Can't figure out why I am getting a comparison error.

(0) ShareShare
ReportReport
Posted on by
I am a new Power Apps user with a background in SQL.  I am trying to basically join 3 tables together but have them filtered before hand, and I cant figure out why I am getting an error for incompatible types for comparison. My tables have more than 2k records so I need the filter.
 
I am referring to them like:
ClearCollect(
         Info,
         AddColumns(
                Filter(Products, ItemId = 6789),
                ProductDetails,                
                LookUp(
                            DeliverySchedule,
                            ItemId = Products[@ItemId]
             )
      )
)
Error would be saying can't compare a number and a table.
If I take away the filter() it is no longer an issue 
 
The sql statment would be something like:
select * from table a
join table b on a.id = b.id
join table c on c.id = b.id
where a.Id = ******


If you know a better way to join 3 tables together in a specific order (table 1, table 2, table 3) so table 1 is the main table and table 2 joins to table 1, then table 3 joins to table 2.
 
 
  • Suggested answer
    Nandit Profile Picture
    1,563 Super User 2025 Season 1 on at
    Can't figure out why I am getting a comparison error.
     
    Can you try using the following please:
    ClearCollect(
             Info,
             AddColumns(
                    Filter(Products, ItemId = 6789),
                    "ProductDetails",                
                    LookUp(
                                DeliverySchedule,
                                ItemId = Products[@ItemId],
                                "columnName"
                 ), "ThirdColumnName", 
                  LookUp(ThirdTable, filterColumn = 6789, "columnName")
          )
    )
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
  • Suggested answer
    ronaldwalcott Profile Picture
    3,587 on at
    Can't figure out why I am getting a comparison error.
    Doesn't your Lookup return a record not a value? Also, not sure why you are comparing ItemId when you have already established its value.
     
    Specify the column which you want to return in your Lookup and double check that you actually want to compare ItemId.
  • Suggested answer
    SudeepGhatakNZ Profile Picture
    14,303 Most Valuable Professional on at
    Can't figure out why I am getting a comparison error.
    Provided that ItemId exists in both ProductDetails and DeliverySchedule tables, try this formula
    ClearCollect(
        Info,
        AddColumns(
            Filter(Products, ItemId = 6789),  
            "ProductDetailInfo", 
            LookUp(ProductDetails, ItemId = ItemId),  
            "DeliveryScheduleInfo", 
            LookUp(DeliverySchedule, ItemId = ItemId)  
        )
    )
     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard