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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

How to show values only if it contains 2 names and disregard those with only 1 name

Hi everyone,

 

I need a way to only show rows which have First and Middle Name. 

 

For e.g.

 

Mary Jane

Mark

Bob John

 

The result will only be:

Mary Jane 

Bob John

 

I am trying to use the contains function ...

 

Middle Name = IF(CONTAINS('Table','Table'[First and Middle Name]," "), SUM(FTEandContractor[First and Middle Name]),BLANK())
 
I get the error that the function Sum cannot work with values of type String. How can I achieve this?
1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Create this measure:

Measure =
VAR _name = SELECTEDVALUE('Table'[name])
RETURN IF(SEARCH(" ", _name, 1, -1) > 0, 1, 0)
 
and filter the visual:
 
Capture.PNG
 
Remember to apply a trim function to this column.


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

Proud to be a Super User!



View solution in original post

1 REPLY 1
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Create this measure:

Measure =
VAR _name = SELECTEDVALUE('Table'[name])
RETURN IF(SEARCH(" ", _name, 1, -1) > 0, 1, 0)
 
and filter the visual:
 
Capture.PNG
 
Remember to apply a trim function to this column.


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

Proud to be a Super User!



Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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