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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.