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 / How to filter a table ...
Power Apps
Unanswered

How to filter a table based on a choice column in DataVerse?

(0) ShareShare
ReportReport
Posted on by 144

How do I filter a choice column?

 

My 'Trade Type' Column has 2 options "Primary" or "Secondary"

 

The error I get is "Incompatible types for comparison. These types can't be compared: OptionSetValue(Type),Text"

 

cnr_0-1632132022983.png

 

Many thanks

Conor

 

Categories:
I have the same question (0)
  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @cnr 

     

    Add at end  .Value like this    'Trade Type'.Value ="Secondary"     I think its choice field 

     

  • cnr Profile Picture
    144 on at

    Hi @Ramole 

     

    Thanks for responding, yeah I tried that but it says "the name isn't valid, this identifier isn't recognized"

    cnr_0-1632134264600.png

     

    I checked my table just to make sure its a choice field, and it is. Does this make sense to you ?

    cnr_1-1632134355252.png

     

    Thanks

    Conor

  • Verified answer
    timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @cnr 

    You should be able to access a 'Trade Type' enumeration, as demonstrated in this example.

    https://powerusers.microsoft.com/t5/Building-Power-Apps/CDS-choice-field-in-Power-Apps/m-p/834646

     

    That specific part of your formula would look like this:

    Filter('Trade Tables', 'Trade Type'='Trade Type'.Secondary)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @cnr,

    Have you solved your problem?

    Do you want to filter based on a Choice field in Dataverse?

    Actually, you should refer to a Choice field as below:

    [@ChoiceFieldName].Option1

    On your side, please modify your formula as below:

    Filter('Trade Tables', 'Trade Type'=[@'Trade Type'].Secondary)

    vqiaqimsft_0-1632275652186.png

     

  • cnr Profile Picture
    144 on at

    Hi @v-qiaqi-msft ,Yes managed to get there in the end, thanks for your response! 

     

    Conor

     

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard