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 / 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
    Microsoft Employee 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard