cancel
Showing results for
Did you mean:
Highlighted
Regular Visitor

## Dax expression- if two columns between certain number

Hi all,

What I basically want to do is clasify a row as valid or invalid if

Column A is between values 5 and 6

Column B is between values -3 and -4 (beware of the negative numbers)

Row_Type = if(('04 GD'[Column A] >=5 ||  '04 GD'[Column A] <=6 )&&  ('04 GD'[Column B]<= -3 || '04 GD'[Column B]>= -4 ),"Valid","Invaid")

There is a logical mistake which I am not able to figure out.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Dax expression- if two columns between certain number

Replace OR with AND

```Row_Type=
IF (
'04 GD'[Column A] >= 5
&& '04 GD'[Column A] <= 6
&& '04 GD'[Column B] <= -3
&& '04 GD'[Column B] >= -4,
"Valid",
"Invaid"
)```
2 REPLIES 2
Super User

## Re: Dax expression- if two columns between certain number

Replace OR with AND

```Row_Type=
IF (
'04 GD'[Column A] >= 5
&& '04 GD'[Column A] <= 6
&& '04 GD'[Column B] <= -3
&& '04 GD'[Column B] >= -4,
"Valid",
"Invaid"
)```
Regular Visitor

## Re: Dax expression- if two columns between certain number

Announcements

Power BI Super User, Greg Deckler, explains

#### Power Platform Summit North America

Register by September 5 to save \$200

#### Back to School Contest

Engage and empower students with Power BI!

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 39 members 967 guests
Recent signins: