0

Sorry I really don't know what is the best title for this question.
I have a mass data, look like this.
And the final output should be like this.
As you can see in the column label (Economic Label), it has
Agriculture, Forestry and Fishing (A)
Commerce, Transportation, Hospitality, Information/Communication
Construction (F)
Finance, Insurance, Utilities, Real Estate/Housing
Manufacturing (C)
Manufacturing Excluding Construction (B-E)
Public and Other Education, Health

But my question is, how this output generated?
Because Agriculture, Construction ... etc, they are in the different columns. If I put it in the columns, it will look like this. It shows the number, not the title of the record.

I know if I have a table looks like this

  |             1            |
--------------------------------
A | economic sector (header) |
B | Agriculture              |
C | Construction             |
D | ...                      |

Then I can let all the title of record show properly. But if I do in this way, I cannot get the number.
My pivot table looks blank, something like this image.

My question is, if there are different title of record in different columns. For example, Agriculture, Construction, Manufacturing ... etc. How can I use this data and put it into pivot table's column and still get the correct number?

akuan10
  • 1
  • 2
  • Hi, please could you add a list of the columns you have in the data source for the pivot table shown in the final link in your post? – FlexYourData May 31 '22 at 22:21
  • @FlexYourData Sorry, I am not a native English speaker, so I don't know what you mean. You mean the name of different industries? Agriculture, Forestry and Fishing (A) Commerce, Transportation, Hospitality, Information/Communication Construction (F) Finance, Insurance, Utilities, Real Estate/Housing Manufacturing (C) Manufacturing Excluding Construction (B-E) Public and Other Education, Health – akuan10 May 31 '22 at 22:27
  • 1
    the final link's pivot table fields: https://imgur.com/a/K88B2Ev – akuan10 May 31 '22 at 22:29
  • No problem. Please edit your post. Add a list of column names in the table that is the data source for this pivot table https://i.stack.imgur.com/ykwJ3.png – FlexYourData May 31 '22 at 22:29
  • OK, give me a moment. I will write an answer. – FlexYourData May 31 '22 at 22:32
  • @FlexYourData thank you so much, I have been stuck on this for hours. – akuan10 May 31 '22 at 22:33

1 Answers1

0

Suppose you start with something like this:

enter image description here

You place your cursor in the table and use Data>Get & Transform Data>From Table/Range. You'll see this in the Power Query Editor:

enter image description here

Select the sector columns, then use Tranform>Unpivot columns.

It will look like this:

enter image description here

Now use Home>Close & Load to put the query back on the spreadsheet.

Create a pivot table from this new data table.

enter image description here

I hope this will be enough to help you get unstuck.

FlexYourData
  • 6,840