Notifications
Announcements
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"
Many thanks
Conor
Hi @cnr
Add at end .Value like this 'Trade Type'.Value ="Secondary" I think its choice field
Hi @Ramole
Thanks for responding, yeah I tried that but it says "the name isn't valid, this identifier isn't recognized"
I checked my table just to make sure its a choice field, and it is. Does this make sense to you ?
Thanks
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)
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)
Hi @v-qiaqi-msft ,Yes managed to get there in the end, thanks for your response!
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 796 Most Valuable Professional
Michael E. Gernaey 327 Super User 2025 Season 2
Power Platform 1919 268