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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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