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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
powerbidev123
Solution Sage
Solution Sage

Error based on a column

powerbidev123_0-1729752588459.png

Can anyone please help as to how to resolve this error. The value is also a text which is showing error and also I have changed the data type of the column to text yet I am getting this data format error.

3 ACCEPTED SOLUTIONS

@smokeyjoe03 , but i need to keep  that "Less than year" value in my column along with the numerical values . How can I go about it?

View solution in original post

The column will have to remain as a string in that case, the "Change Type" operation operates on every value in the column so even just 1 value that isn't a number or NULL will cause the error.

As a workaround I suggest making two columns:

  1. A Number column but replace your "Less than a Year" with a 0. This will allow you to use this column to do mathematical operations still.
  2. A String column that keeps the numbers as strings and allows the value "Less than a Year". This can be used for display purposes.

It would look something like this:

YearsColumn (Number)DisplayColumn (Text)
0Less than a year
11
55

View solution in original post

Thanks for the solution @smokeyjoe03 

View solution in original post

5 REPLIES 5
Omid_Motamedise
Super User
Super User

What formula do you used?

 

It mention you are going to compare date and number which is impossible, instead of using number like 2, use #duration(2,0,0,0)


If my answer helped solve your issue, please consider marking it as the accepted solution.
smokeyjoe03
Frequent Visitor

In the "Details" in the error it suggests the value you are trying to change to a number is the string "Less than a Year"

Anything in that column that isn't a numerical value will cause the error when converting it.

@smokeyjoe03 , but i need to keep  that "Less than year" value in my column along with the numerical values . How can I go about it?

The column will have to remain as a string in that case, the "Change Type" operation operates on every value in the column so even just 1 value that isn't a number or NULL will cause the error.

As a workaround I suggest making two columns:

  1. A Number column but replace your "Less than a Year" with a 0. This will allow you to use this column to do mathematical operations still.
  2. A String column that keeps the numbers as strings and allows the value "Less than a Year". This can be used for display purposes.

It would look something like this:

YearsColumn (Number)DisplayColumn (Text)
0Less than a year
11
55

Thanks for the solution @smokeyjoe03 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.