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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
amconnel
Resolver II
Resolver II

Expression.Error when Pivoting Colum

All,

 

I have a column labeled 'Metric' where I have listed out things like Net Sales, EBITDA, COGS, Tax, etc. and another column labeled 'Value with the corresponding values for those metrics. I need to pivot the 'Metric' column so that I have columns for Net Sales, EBITDA, COGS, etc. with all corresponding valyes shown underneath. 

 

I am receiving the following error when attempting to pivot the column:

Expression.Error: We cannot convert the value null to type Number.
Details:
Value=
Type=[Type]

 

I have tried the following to fix the issue:

- Checked that the 'Metric' column is text.

- Checked that the 'Value' column is decimal number.

- Replaced all null and blank values in the 'Metric' column with the word "blank."

- Replaced all null and blank values in the 'Value' column with "0."

 

Any ideas on how else to resolve this error? 

 

Thank you!

1 ACCEPTED SOLUTION
amconnel
Resolver II
Resolver II

I believe there was a file that had been appending with the original query that was causing the problem. This additional file did not necessarily have columns that aligned fully with the original query, so there may have been more than one data type in at least one of the columns I was handling. 

Once I removed this problem file from the source in the query, the pivot column worked like it should. The files do not necessarily need to be in one query; just thought it would be convenient. 

View solution in original post

1 REPLY 1
amconnel
Resolver II
Resolver II

I believe there was a file that had been appending with the original query that was causing the problem. This additional file did not necessarily have columns that aligned fully with the original query, so there may have been more than one data type in at least one of the columns I was handling. 

Once I removed this problem file from the source in the query, the pivot column worked like it should. The files do not necessarily need to be in one query; just thought it would be convenient. 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.