Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Aydeedglz
Helper V
Helper V

If statement, if the values of Column1 are different from multiples values, then

I am trying to create a formula where "if the values of Column1 are different from "value1", "value2", "value3", "value4", then "error" if not "ok"

Also there is blank category and spaces that seem like blank and I am trying to incloude them or find a way to ignore them

Aydeedglz_0-1686171975471.png

 

 

I have tried like this:

 

Validation =
Var VARIABLE1 = SELECTEDVALUE('TABLE1'[Classification])
Return
IF(TABLE1 <> "Value1" || "Value2" || "Value3" || "Value4" || "Value5" || " " || "blank", "Error, "Ok")
 
But is not working because in my table I only have those values ("Value1" || "Value2" || "Value3" || "Value4" || "Value5" || " " || "blank") and is showing error like if it has another value different from them
1 REPLY 1
vicky_
Super User
Super User

You can try re-write the formula as the following:
IF(SELECTEDVALUE('TABLE1'[Classification]) in {"Value1", "Value2"...etc}, "Error", "OK")

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors