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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
adamjclee
New Member

Power Query: Always getting DataFormat.Error We couldn't convert to Number

I'm new to using Power Query and I seem to always get error:DataFormat.Error We couldn't convert to Number. This seems to happen when it really shouldn't so I'd be grateful for an explanation. For example:

 

I have the following data:

 

Temp.jpeg

As can be seen, dep_delay is a column of numbers and carrier is a text column. If I try to Pivot on carrier, with dep_delay as value and aggregation function Average, I get a DataFormat.Error We couldn't convert to Number. This is non-sensical to me - everything that needs to be is already of type number.  I get the same error if I try to close and load the query.

 

Worth noting is that, if I simply import the Table from csv using get and transform - but not the PQ editor - the data loads correctly and I can do this pivot etc. in Excel with absolutely no issues - suggesting something strange is going on in PQ. (Perhaps worth mentioning is that I'm using PQ on a mac).

 

Grateful for any suggestions as to why this might be occuring.

 

5 REPLIES 5
rajulshah
Resident Rockstar
Resident Rockstar

@adamjclee 

Can you please provide the screenshot of the error?

Sure. First here is the pivot options box.

Temp.jpeg

 

When I click on OK, I get the following:

Temp.jpeg

@adamjclee 

We are taking average of the values. But since it has "true" value it cannot take the average.

You can take min or max.

Please let me know if this didn't work.

I'm afraid I don't follow. There is no Boolean (TRUE/FALSE) column, and if something is being converted into Boolean, then something else is going wrong earlier on. The "value column", which the aggregation function ought to be applied to is a column of (decimal) numbers. So it certainly should be able to take the average.

On a related point, if I understand your comment correctly, you are saying that I cannot average a Boolean column to find the proportion of true values? Or, more precisely, Booleans are not cast to numbers [true = 1; false = 0] when applying numerical operations, unless one explicitly changes the type?

@adamjclee , yes, you are correct!
Can you try to filter if there is any such value?

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.

Users online (2,211)