Excel Pivot Tables - Use same field as row and column label - excel

Looking to create a pivot table with the same field for row & column labels.
If this isn't possible in Excel, is there a suitable alternative within excel to accomplish the same result?

Plan B.
Two columns in your source data that are identical, one for ROWS one for COLUMNS.

Related

Pivot Table - Keys from multiple columns

I've been trying to build a pivot table that uses keys from multiple columns.
This would be the source table (Items 1,2,3 columns represent the keys):
[
This would be the resulting Pivot Table (The pivot table consolidates key "A" even though it is placed in other columns) :
]2
Sorry if this is a terribly easy one to solve.
Thanks in advance.
You need to use a consolidation range pivot table. Alt+DP, then choose consolidation ranges as the source and add each pair of columns separately. You'll need the pairs of columns to all have the same headers.
Note also that consolidation range pivots are quite limited in terms of what you can do with them.

Excel: transpose rows to columns and merge

I would like to present some data in Excel in a table. I have a sheet with three columns: date, time_spent and user_id. Every row is a data record. I want a table with a column for every date and every value with time spent below the date.
Using the transpose function under paste special I get this:
However I would like only one column per unique date, so the amount of columns decrease like this:
Does someone know how to do this?\
I have more than 10000 rows, so manually is too much effort...
Using Pivot Tables as Tim Biegeleisen suggested I cannot get what I want either, I'm not an expierenced user of Pivot Tables so probably I'm doing something wrong:
Excel file as shown in above picture
Here is one way of using a Pivot Table as suggested by Tim above in the comments, but you must use it on your original, non-transposed data: (and note which parameters go to which areas.
A disadvantage of the Pivot table is that the column headers are text strings and not dates. If your version of Excel is 2010+, you can use Power Pivot or Get and Transform to do a better job:
Open the Query Editor, change the format of the Date column, and Pivot the column:
Then Save the results:
Advanced filter dates to unique values in a new column
Copy and transpose them to make your column titles
Insert a new column B with the formula =TEXT(A2,"yyyyddmmm")&COUNTIF($A$2:A2,A2) and fill down
Below your new column headers put in the formula =IFERROR(VLOOKUP(TEXT(H$1,"yyyyddmmm")&ROW()-1,$B$2:$C$8,2,FALSE),"") and fill down and across. You will need to fill it down to cover the maximum number of instances of each date.
Adding a sumif to this table and your initial table would be a good way to check you got everything.

Excel Slicers for Measures

I have a cube with two measure(count of patients) and (distinct count of visits) , and various dimension(date,program,region,etc), when I browse the cube data from excel, I can choose all the dimensions in the slicer, but my question is is there anyway i can choose the measures in the slicer? From what I see, when I insert a slicer I only get to pick the dimesnions
Any help would be appreciated
I'm not sure of a way around using PowerPivot to do this, short of complicated VBA scripts.
To do it with PowerPivot:
Create a new table with two columns. Column 1 contains the name of your measures and column 2 contains an index for each. e.g.
and add this to the Data Model (but don't create any relationships to any other tables).
Create a new measure with a SWITCH function that has the same relationship between the measures and their values in the Index column, e.g.
[Chosen Measure]:=SWITCH(TRUE, MIN(MeasureTable[Index])=1, [DistinctPatients], MIN(MeasureTable[Index])=2,[DistinctDates])
Add the new measure to the values section of the pivot table and add the
Measure column from your new table to BOTH a slicer AND the column headings in the pivot table and remove the row and column totals.

Add two columns in Excel Pivot Table

I'm running into a bit of a problem which I'm guessing there exists an easy solution to which I've overlooked.
I'm trying to add a column to a pivot table that is the sum of two other columns in the pivot table. All of the documentation that I've seen has told me how to make a calculated field based on the columns in the original data set.
I've added a column to the right of my pivot table that does exactly what I want - summing columns B and C in the pivot table:
Unfortunately this column is not considered as part of the pivot table so pivot charts do not include it.
There HAS to be an easy solution to this that I'm overlooking. Does anyone know what I'm doing wrong?
Best regards,
MoarCodePlz

Excel Compare tables

I have 2 excel pivot tables with 2 columns but got different number of rows.
The first column of each table got and Number, and the column 2 got a value.
I want to compare both tables, finding the same Number on Column 1 for each table, and sum the values of column 2.
The easiest way to do this is copy and paste (as values) the pivot tables to a new sheet, then use vlookup to compare the values Ref Vlookup. There are more complex and reusable solutions, but you would need to define if you want to use a macro, or other tools.

Resources