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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Conditional column from: if not a number then ...

Hi,

 

Trying to figure how to do this but no luck so far.

 

Col1, type text, contain two rows, "K" & "1"

 

What I want to do is add a column using logic like this: if Col1 not a number then Col1 else null.

 

I am think I need something like: if (!ParseAsNumber(Col1)) then ...

 

Suggestions appreciated.

 

Thanks,

 

-Wes

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this Custom Column in Query Editor

 

=let mylist=List.RemoveItems(List.Transform({1..126}, each Character.FromNumber(_)),{"0".."9"})
in

if List.Contains(mylist,Text.From([Column1])) then [Column1] else null

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this Custom Column in Query Editor

 

=let mylist=List.RemoveItems(List.Transform({1..126}, each Character.FromNumber(_)),{"0".."9"})
in

if List.Contains(mylist,Text.From([Column1])) then [Column1] else null
Anonymous
Not applicable

That works. Thanks so much.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors