# Create column with conditional

#### LINUS_MAASTOK

##### New Member
I everyone, im new in power bi / power query and I need to know how to create a column in a table IF the value of a specific column is between a range of one of two different column values.

Something like: create a column 4 where the value is the same as the value in column 1 IF this value is + -5% of the value in column 2 OR it is + -5% of the value in column 3

Example:
IF(
( (table[column1]) < table[column7]*1.05 ) AND (table[column1]) > table[column7]*0.95 )
OR
((table[column1]) < table[column8]*1.05 ) AND (table[column1]) > table[column8]*0.95 ) ) )
THEN table[column1] (**or the value of any other column)

Btw, excuse me for my bad english ;(

### Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

#### CsJHUN

##### Active Member
Hi how about something like this:
=if(or(and(c1<c7*1,05; c1>c7*0,95); and(c1<c8*1,05;c1>c8*0,95));c1;"")

(sry on phone, check back later)

I hope this helps!

John

#### LINUS_MAASTOK

##### New Member
i have an issue... the table that im using is a Merge of 2 other tables, so it doesnt leave me create a column ; "A cyclic reference was encountered during evaluation"

#### sandy666

##### Well-known Member
could you post representative example which reflect structure and type of data in Excel file which also contain expected result?

uwu

Last edited:

have a nice day