cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

create an indicator to differentiate when a value doesn't contain a specific code

Using PowerBI, I have to create an indicator to differentiate when a value doesn't contain a specific code.

Example:

Invoice# SubNumber# Report Code
AL123        Al123-0            AB
AL123        AL123-1           AN
AL123        AL123-3           AC
AL124        AL124-0           AB
AL125        AL125-0           AB
AL125        AL125-1           AN

in the case above, I need to put an indicator on the invoices: AL124 AND AL125, because they don't contain Report Code "AC"

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: create an indicator to differentiate when a value doesn't contain a specific code

@ac1_ , Try a new column like

contains AC = if(countx(filter(Table,[Invoice#] =earlier([Invoice#]) && [Report Code] ="AC"),[Invoice#] )>=1,"Yes","No")


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

3 REPLIES 3
Highlighted
Super User IV
Super User IV

Re: create an indicator to differentiate when a value doesn't contain a specific code

Put Invoice# in a Table visualization. Then create a measure like:

 

Measure = IF("AC" IN DISTINCT([Report Code]),1,2)

 

Your 2's are the invoices that do not contain "AC"


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

Putting square pegs in round holes since 1972.

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

Re: create an indicator to differentiate when a value doesn't contain a specific code

@ac1_ , Try a new column like

contains AC = if(countx(filter(Table,[Invoice#] =earlier([Invoice#]) && [Report Code] ="AC"),[Invoice#] )>=1,"Yes","No")


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Regular Visitor

Re: create an indicator to differentiate when a value doesn't contain a specific code

Thank you this one worked!

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors