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

Compare a String to measure

Hello,

 

I would like to make a comparison with a string of a column, I could not use the if, and I do not know which function is suitable for comparing string.

 

Ex: Table 1, cololuna1:

a

b

c

ab

a

c

ab

 

I want to make a measure that returns only the desired values, for example "ab" which in this case exists 2. If (Table1, cololuna1 = ab); return blank. This is the concept.

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Compare a String to measure

Hi @strikw,

 

Do you want to count the "AB" values?

 

You should use something like:

 

Measure = CALCULATE(COUNT(Table1[Column1]), Table1[Column1] ="AB" )

Regards,

MFelix



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

Proud to be a Datanaut!




View solution in original post

5 REPLIES 5
Super User
Super User

Re: Compare a String to measure

Hi @strikw,

 

Do you want to count the "AB" values?

 

You should use something like:

 

Measure = CALCULATE(COUNT(Table1[Column1]), Table1[Column1] ="AB" )

Regards,

MFelix



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

Proud to be a Datanaut!




View solution in original post

strikw Regular Visitor
Regular Visitor

Re: Compare a String to measure

Hello,

 

In this case I do not want to do a count, I want to take this value to create a condition.

For example, all "ab" values will return me blank.

 

Have a great day.Att, Paulo Dantas.

Super User
Super User

Re: Compare a String to measure

Do you want to do it at a column level? or compare all values from a specific range?

 

 



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

Proud to be a Datanaut!




strikw Regular Visitor
Regular Visitor

Re: Compare a String to measure

Hello,

Just for the column.

Super User
Super User

Re: Compare a String to measure

Add a calculatted column with the following syntax:

 

Valid = IF ( Table[Column] = "AB", "OK", "")

Regards,

MFelix



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

Proud to be a Datanaut!




Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 120 members 1,514 guests
Please welcome our newest community members: