Power Query: pivot column with text as value field

tombamber

New Member
Joined
Mar 28, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi

I want to use Power Query to pivot a set of data, but instead of the value cell being a number, it is text.

I need to turn this:

1703085815236.png


into this:

1703085842683.png


This is just an example of how the data is setup, using PQ does work for this data, but when I try it with my actual data I get the following error:

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

Thanks
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
You just need to transpose the columns. Assuming your Excel table is called "Table1", you could do the following:

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Transposed Table" = Table.Transpose(Source),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true])
in
    #"Promoted Headers"
 
Upvote 0
Hi

I want to use Power Query to pivot a set of data, but instead of the value cell being a number, it is text.

I need to turn this:

View attachment 103865

into this:

View attachment 103866

This is just an example of how the data is setup, using PQ does work for this data, but when I try it with my actual data I get the following error:



Thanks
I figured out there is a blank/null row in the questions column which was causing the issue.

I've removed null now and it works.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top