cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Number comparison error in conditional column

Hi,

 

I am trying to compare two whole numbers in a conditional column. A equals compare work but a less than or equal compare give an error.

 

Equals works 

= Table.AddColumn(Previous, "NewCondCol", each if [IPAsInt] = VpnNet[StartIpAsInt] then true else false)

 

But I get an error when I change it to greater than or equal

= Table.AddColumn(Previous, "NewCondCol", each if [IPAsInt] >= VpnNet[StartIpAsInt] then true else false)

 

Error:

 

Expression.Error: We cannot apply operator < to types List and Number.
Details:
Operator=<
Left=List
Right=2384469417

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Number comparison error in conditional column

Hi @wevernde , 

According to your error, this seems to be related to the data type, I saw left value is List, I think you need to expand the list , then compare the value. By the way, you also could inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Super User IX
Super User IX

Re: Number comparison error in conditional column

I believe in Power Query it is le and ge

---------------------------------------

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Community Support
Community Support

Re: Number comparison error in conditional column

Hi @wevernde , 

According to your error, this seems to be related to the data type, I saw left value is List, I think you need to expand the list , then compare the value. By the way, you also could inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
New Member

Re: Number comparison error in conditional column

I see the problem now. I am comparing a number to a list and only equal and not equal are supported. 

 

Thanks

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.