cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mazharmh Member
Member

not equal operator not filtering

I  am trying to calculate a measure using below formula , But its not filtering properly

  NOT EQUAL OPERATOR<> Not giving desired output

 

Please advice thanks

 Franchise = CALCULATE(

SUM('Model'[Sales]),
FILTER(
'Model',
('Model'[Store] = "1" && 'Model'[AccountID] <> "11435") ||
('Model'[Store] = "2" && 'Model'[AccountID] <> "15663") ||
('Model'[Store] = "3" && 'Model'[AccountID] <> "9863")  ||
('Model'[Store] = "4" && 'Model'[AccountID] <> "9483")  ||
('Model'[Store] = "5" && 'Model'[AccountID] <> "11435" )||
('Model'[Store] = "1" && 'Model'[AccountID] <> "8351") ||
('Model'[Store] = "3" && 'Model'[AccountID] <> "9288") ||
('Model'[Store] = "4" && 'Model'[AccountID] <> "9288") ||
('Model'[Store] = "5" && 'Model'[AccountID] <> "8351") ||
('Model'[Store] = "1" && 'Model'[AccountID] <> "4378") ||
('Model'[Store] = "2" && 'Model'[AccountID] <> "4378") ||
('Model'[Store] = "3" && 'Model'[AccountID] <> "8411") ||
('Model'[Store] = "4" && 'Model'[AccountID] <> "8411") ||
('Model'[Store] = "5" && 'Model'[AccountID] <> "4378") ||
('Model'[Store] = "6" && 'Model'[AccountID] <> "4378" )
)
)

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: not equal operator not filtering

Also is your number formatted as Text or Whole Number, Decimal Number or Fixed Decimal Number? As that could then also affect the <>


Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Power BI Blog

View solution in original post

6 REPLIES 6
Super User
Super User

Re: not equal operator not filtering

Hi there, do you have some sample data, as well as what the current output is and the desired output?

It would appear that you might be able to create this filter in the Query Editor which will then make it a lot easier to create your measure without having so many conditions.

Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Power BI Blog
Super User
Super User

Re: not equal operator not filtering

Also is your number formatted as Text or Whole Number, Decimal Number or Fixed Decimal Number? As that could then also affect the <>


Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Power BI Blog

View solution in original post

Highlighted
mazharmh Member
Member

Re: not equal operator not filtering

Thanks for your help @GilbertQ it worked when I changed data type of parent id,  FROM TEXT TO WHOLENUMBER

 

Thanks

Mazhar

Super User
Super User

Re: not equal operator not filtering

Great that you got it working

Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Power BI Blog
vippankapoor Frequent Visitor
Frequent Visitor

Re: not equal operator not filtering

Please help which opertor to be used if arguement to be filtered is set as "Text".  Operator "< >" is not working for filtering @ "Not Equal to".

Thansk in advance

Super User
Super User

Re: not equal operator not filtering

Hi there

Do you have a working example we could have?

Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Power BI Blog

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 1,304 guests
Please welcome our newest community members: