cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
wevernde Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Super User
Super User

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

@wevernde 

 

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
Try my new Power BI game Cross the River

View solution in original post

2 REPLIES 2
Super User
Super User

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

@wevernde 

 

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
Try my new Power BI game Cross the River

View solution in original post

wevernde Frequent Visitor
Frequent Visitor

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

That works. Thanks so much.

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (3,751)