cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Need to create a Measure to place it at visual level filter

Hi Team,

 

Need help to create a measure which i will be using as visual level filter on a Report. 

 

 I have a customer table with customerid, I dont want to create calcualted column but make use of mesaure.

 

Code logic that i would like to have in measure.

 

Customerid not in ('1234',2345',3452',2647',2348')

 

Any help is highly appreciated.

 

Thanks in advance.

4 REPLIES 4
Highlighted
Super User IV
Super User IV

@korare532 - Perhaps:

 

Measure =
  VAR __CustomerID = MAX('Table'[CustomerID])
  VAR __Table = { '1234',2345',3452',2647',2348' }
RETURN
  IF(NOT(__CustomerID IN __Table),1,0)

IDK, I mocked up both in a sample file and both seem to work. You can just filter on the 1 or the 0. See PBIX attached below sig. You want Page 3, Table (3).

 


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted

Hi @Greg_Deckler ,

 

Thanks for quick response.

 

The measure outputs is showing as 1 for all the values in the list if i use Not function. My desired out put is the customerid column should eliminate those values present in the list.

 

If in a table visual, if I place customerid columns from table and the measure , it should show me those values that are not in the list. 

 

Hope my requirement is clear. 

Highlighted

How about:

 

Measure 3a = 
  VAR __CustomerID = MAX('Table (3)'[CustomerID])
  VAR __Table = { "1234","2345","3452","2647","2348" }
RETURN
  IF(__CustomerID IN __Table,0,1)

 

IDK, I mocked both up in a file (attached below sig) Table (3), Page 3. Maybe because your stuff are numbers 1234, 2345, 3452 instead of text? 


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Super User IV
Super User IV

@korare532 , Try a measure like

calculate(sum(Table[value]) , filter(table, not(Customerid in {"1234","2345","3452","2647","2348"})))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors