cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
purnima13 Regular Visitor
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.
Please help !

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Dax expression- if two columns between certain number

Hi @purnima13

 

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
Super User

Re: Dax expression- if two columns between certain number

Hi @purnima13

 

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"
)
purnima13 Regular Visitor
Regular Visitor

Re: Dax expression- if two columns between certain number

@Zubair_Muhammad Thank you Smiley Happy

Helpful resources

Announcements
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 39 members 967 guests
Please welcome our newest community members: