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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors