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 / If statement with "cho...
Power Apps
Answered

If statement with "choice" columnn

(0) ShareShare
ReportReport
Posted on by 57

I try to create a column in a Dataverse (table) and make simple if- function but it does not work.

 

The column named "Year" has data type choice.

I created  two choices ("Sync with global choice": No) with label: "24", value "1" and label "25", value "2".

 

I created a new column named "test". Data type "Formula (Preview)". The formula is: "If( Text('Year'.Value)=1, 1, 0) but it does not work.

I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @Lonsdejlit ,

     

    First of all, when creating an option-set, please do not modify default Value values as they are inner ids:

    vjefferni_0-1679368871944.png

     

    So, I assume the choices of Fx are 1&2:

    vjefferni_1-1679368977704.png

     

    FxText is the Choice column:

    vjefferni_2-1679369033560.png

     

    Formula column expression would be as follows:

    vjefferni_3-1679369150293.png

    If(ChoiceColumnName = OptionSetName.ChoiceValue, result1, result2)

     

    Best regards

  • GrantBaker Profile Picture
    6 on at

    Thank you for this!

  • psantostriumph Profile Picture
    6 on at

    Thank you so much @v-jefferni 

     

    Just want to add for people like myself who just found Dataverse 3 days ago. 

     

    To create the option set (1 step in the solution) you must have the "Sync with global choice" selected to Yes before you add the "New choice". I had it to "No" and was just not getting there, even if it was in the posted image.

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