Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
strikw
Helper I
Helper I

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

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


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

5 REPLIES 5
MFelix
Super User
Super User

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


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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.

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

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hello,

Just for the column.

Add a calculatted column with the following syntax:

 

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

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.