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
TomLU123
Helper III
Helper III

Validate the Name Format in the Dataset

Dear Experts, 

 

I am building a report to validate the Name Format in a data set. 

The correct name format should be "First Name + Space + Last Name" (e.g. Tom Lu)

Any of following formart is invalid:

  • If there is no space between First Name and Last Name, it is invalid. 
  • If there is space within the First Name, it is invalid. 
  • If there is no Last Name, it is invalid. 
  • If there is no value, it is invalid. 
NameValidation Result
Tom LuValid
AndyWuInvalid
Mei Xin WuInvalid
SmithInvalid
 Invalid
Jim WongValid 

 

Is it possbiel to create a custom column to achieve it?

Many thanks!

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @TomLU123,

 

Based on my test, we can take the following steps to meet your requirement.

 

1.Enter the data as you described and new a column using the formula.

 

c2 = SUBSTITUTE(Table1[Name]," ","")

 

2.Create another new calculate column by the formula.

 

Validation Result2 = IF(ISBLANK(Table1[c2]),"Invalid",IF(LEN(Table1[c2])+1=LEN(Table1[Name]),"Valid","Invalid"))

3.Then we can get the result as we excepted.

1.png

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/ggcwbz7ag0xjqum/Validate%20the%20Name%20Format%20in%20the%20Dataset.pbix?d...

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @TomLU123,

 

Based on my test, we can take the following steps to meet your requirement.

 

1.Enter the data as you described and new a column using the formula.

 

c2 = SUBSTITUTE(Table1[Name]," ","")

 

2.Create another new calculate column by the formula.

 

Validation Result2 = IF(ISBLANK(Table1[c2]),"Invalid",IF(LEN(Table1[c2])+1=LEN(Table1[Name]),"Valid","Invalid"))

3.Then we can get the result as we excepted.

1.png

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/ggcwbz7ag0xjqum/Validate%20the%20Name%20Format%20in%20the%20Dataset.pbix?d...

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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.