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! Learn more

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
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