How to Transpose Columns to Rows and add redundant data - excel

I'm trying to find a solution in Power Query to transpose Table 1 into Table 2 (in the link). I have seen other transpositions on this forum but not one quite like this where I need redundant data to be added. Does anyone know a way to do this type of transposition using Power Query or Excel in general?
How can I transpose Table 1 to look like Table 2?
Looking for suggestions...

In the Query Editor, select the columns for your stores and then on the Transform tab of the ribbon, select Unpivot Columns > Unpivot only the selected columns.
Here is a snip of a data table (blue) and the unpivoted result below (yellow).

Related

Quick reshaping of table in Excel

I'm new to using Excel/DAX.
Just wondering if there would be a quicker way to format the table
What I'm trying to achieve, is getting the above table to be formatted the same as below
Notice how in the lower table there is only 1 column for the year. I understand that this creates duplications of the countries in the first column
Any advice would really help.
Load the table into PowerQuery
Select the first 2 columns
In the Transform tab select from Unpivot other columns
There you go!
Btw, it's a typical ETL step (hence PowerQuery) called stacking a table from wide to long.

Convert Excel table based on Column Values using VBA

Have this Table below ,
I would Like to use the Header Column to transform the Table like this
Any Help It will be great, Best regards
Hala
You can easily solve this puzzle with a pivot table. Put the amount field into the values section of the pivot and set to get sums. Put the header field into the columns section of the pivot. And put the rest fields into the rows section of the pivot. Pivot will auto-show the grandtotal and subtotals per rows but you can remove them easily with a right click on it. And finally to get a view like a data table click repeat all item labels in pivot's report layout.

Export a filtered view from PowerPivot into Excel

I don't have any concrete example but I have a PowerPivot table containing nearly 2 million lines. Users will work on it regularly and filter down until they get the data that they want. Filters will always change depending on the user and on the information that they are looking for.
My question is: is there a way to extract into a simple table or pivot table the information from the PowerPivot BUT the active filtered information only?
So let's say for example I have table1 containing 2 million rows. I apply different filters in the table to narrow it down to 10,000. Is there a way for me to extract those 10,000 rows specifically in a simple Excel table or pivot table?
The quickest and easiest way is to copy the table, and paste into a Worksheet.
Right click the intersection of Row / Column Headers and select Copy:
Only the visible filtered rows will be copied.

How to transpose Excel Pivot table

I have source table where I have every number category in separate column (something like already pivoted).
I would like to create pivot table, where division are in columns and number category in rows.
I need to transpose columns with rows from this layout:
to something like this:
Is it possible within standard pivot without Power query and unpivoting my data? (I guess with PQ it would be bigger and took longer to refresh).
In the pivot field pane, drag Values from the Columns box to the Rows box, and drag Divisions from the Rows box to the Columns box.

How to get the counts/frequencies of values in a table?

I have the problem that I need to get the number of occurences / the counts or frequencies of values in a table. However, I cannot give the categories before, so in opposite to countif I cannot specify a specific value, as this needs to be done from the table. I have a whole table, not just a column. The picture shows a reduced example:
The result I need would look like the following (I counted manually, hope I did not do a mistake):
It is not needed to calculate empty cells.
For the starting point I am ok with not specifiying if there is a difference between lowercase and uppercase (so L and l for example). This can be calculated separately or as the same. Later on it would be good to be able to choose this as an option. (I could use lowercase function and refer to this column and fill another column with the values, however the original data is way too large.). My problem is now that I am not able to do this "simple" task. I found a solution for a single column, using a matrix function with countif:
{=countif(A21:A27;A21:A27)}
This does not work for a whole table. My original data is too large to do any task manually and repeat this for each column or rearrange the data manually from table to one single column.
Unfortunately I am limited to Excel and/or Excel VBA. I cannot use any other tool. I am happy with an excel solution, if there is a way to do it in VBA I am also very ok with it, however for this I cannot give a proof that I tried it, because I don't have an idea how to program this and I am not advanced enough in coding VBA.
Through PowerQuery
Sample data:
My Excel is in Dutch so excuse me for making some translation errors. It should still point you in the right direction:
1: Select all data > Data Tab > Transform > From Table/Range > Choose No headers
2: In PQ select all 4 columns > Transform Tab > Unpivot all columns
3: Select value column > Transform Tab > Pivot Table > Ok
4: Select all columns > Transform Tab > Unpivot all columns again
5: Exit PowerQuery and confirm to save your edition.
Result:
Will exclude empty cells
Will distinguish between upper and lower case
Analyzing this data is easiest if it is in one column. You can use Power Query (Get & Transform) for that. Load the data into the Power Query Editor, keep only column 1. Repeat and keep only column 2, repeat for columns 3 and 4.
Next, append the columns, so you have one column of data.
Now you can either load this data into the data model and THEN it's easy to build a pivot table. Blank cells can be removed in the Power Query or by filtering the pivot table.

Resources