Forum Discussion

bcap01's avatar
bcap01
Icon for Helper II rankHelper II
3 years ago

IS ELSE Statement based on STRING

Hello,

 

I want to create an IF ELSE Statement based on string values.  I want to do something like the below but is generating an error.  Any suggestions on what might be off? 

 

The message I get is, "A single vlue for column "UserEMail" in table "ReportTable" cannot be determined.  THis can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as MIN, MAX, COUNT, or SUM to get a single result."

 

However, when I attempt to use MIN, MAX, COUNT, or SUM, the values never match always defaulting to the "Red" color in my statement below.

 

Measure = if(ReportTable[UserEmail]=USERPRINCIPALNAME(),"green","red")

 

 

2 Replies

  • bcap01 , Measure can use measure, constants and aggregated columns

     

    Measure = if(Max(ReportTable[UserEmail])=USERPRINCIPALNAME(),"green","red")

    • bcap01's avatar
      bcap01
      Icon for Helper II rankHelper II

      Thank you amitchandak !  When I do this, the results are the same and the ELSE color populated the fill of the button.  My hope and expectation is that the Button fill will change based on my IF ELSE Statement, do I need to do something different to make this work?