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
Julio-YYC
Helper II
Helper II

How to validate an entry by an specified field format

Hello PBI Community, 

 

I have a request in my report that I am not sure how to get sorted. Let me try to explain here. I have a column with a Tag number, and the format for this entry must be: three numbers, dash, two letters, dash, four numbers 

I'd like to have a measure to validate this Tag number format with a Yes or No. If the Tag meets the standard format (three numbers, dash, two letters, dash, four numbers ),  then it will be a yes; otherwise, it will be a no. 

 

JulioYYC_0-1664336422336.png

 

does anybody has any idea how to get that? 

 

Thank you,

Julio

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Julio-YYC , Create a new column in power query like this

 

let _a = Text.Split([Tag],"-")
in
if Text.Length (_a{0}) =3 and Text.Length (_a{1}) =2 and Text.Length (_a{2}) =3 then 1 else 0

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Julio-YYC , Create a new column in power query like this

 

let _a = Text.Split([Tag],"-")
in
if Text.Length (_a{0}) =3 and Text.Length (_a{1}) =2 and Text.Length (_a{2}) =3 then 1 else 0

Hi Amit, all good with the syntax... I entered it as a custom column. One more question, how would the query be if this field "Text.Length (_a{1}) =2" would accept as text length either 2 or 3?

 

thank you

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.