Why am i getting null and zeros in pivot field values column in tableau? - pivot

enter image description hereHi,
When i try to convert my data source( that contains a list of countries as columns with daily deaths noted)into pivot(converting the list of country columns into a single column with all the countries as rows) in tableau, I am getting null values for the column pivot field values.
Here i am attaching my original data source and the sheet which is pivoted

The pivot values show null because there are no data available. Note that, the Tableau data pane will only show you a sample of your data. when you go into Tableau sheet to create your views you can drag pivot value into text in the marks card. That is a true test to see if there are numbers in the pivot value field.

Related

Showing the value corresponding to the biggest date per date group in Pivot Table in Excel

Edit: This is my first question so I can't yet embed images.
Consider a very simple dataset that has a Date column and a Value column. The Value column can be a numeric measurement of any kind.
Screenshot of a simple Excel table with a Date column and a Value column
I want to create a Pivot Chart out of this dataset to visualize and interact with the data. However, when grouping the Date field in the corresponding Pivot Table, the Value field can only be summarized as a sum, count, average, min, max, etc., and I want the Pivot Table to show the Value corresponding to the biggest date in the Date group.
For example, if I don't group at all the Pivot Table correctly shows the Value for each day. But if I group Date by months I want the Pivot Table to show the Value corresponding to the last date of the month not the sum of Values for the entire month, the count of Values, the average of Values, etc. Similarly, if I group by quarter I want to get the Value corresponding to the last day of the quarter; if I group by year, then the Value for the last day of the year and so on.
Ι've already tried looking into Calculated Fields but I can't use XLOOKUP. I've also tried rearranging the fields in the Pivot Table as suggested by this other question Pivot tables in excel - showing last values, but that results in the latest Date for each Value (e.g. the latest date where the value "42" was seen).
The most promising thing I've tried is using the Date field in the Rows and Values section of the Pivot Table Fields panel and then adjusting the Value Field Settings to summarize by max.
Screenshot of the Pivot Table Fields panel showing the Date field in the Rows and Values sections
This returned the biggest date per Date group which seems closer to what I want but I don't know yet how to get the corresponding Value for that date (within the Pivot Table that is).
Screenshot of the resulting Pivot Table based on the previous settings
With the following measure defined within Power Pivot:
Value for Latest Date :=
VAR LatestDate =
MAX( Table1[Date] )
RETURN
CALCULATE(
MAX( Table1[Value] ),
Table1[Date] = LatestDate
)
which can then be dragged into the Values area of the Pivot Table.

My Pivot Table is showing the text value "me" instead of a date

I have a simple Pivot Table with Date as Row and Revenue as summed summed Values, Values in column. However, instead of listing all the September dates, it is showing the word "me" instead of 2-Sep. I checked my data table and there is nothing there that matches "me". My data table only has dates and revenue, nothing else. There is not a single cell with the value "me" in my entire sheet. Has anyone else experience this?

Count only "specific words" visible cells in a filtered pivot table

I want to count only visible cells in Column Q that say "ME". I tried =COUNTIF(Q1:Q469,"ME") but it gave me the total for ALL of the cells in the table including the unfiltered results. I just want to count how many "ME" that are in Feb. I also tried SUBTOTAL but wasn't able to make it work.
I'm working on an older version of excel.
Add a new column to your data set with the following formula:
=countif(Q1,"ME")
This column should return 1s and 0s based on the values in your Inspected by column.
Update the pivot table to include this new data source and hit refresh.
Drag the new column to the value section of your pivot table fields list and summarize by Sum.
Include a grand total row ("on for columns only") in Design. The grand total will give you a total count of "ME" and update accurately as you filter through data.

Excel Count unique value multiple columns

I have a workbook with multiple sheets. On sheet1 I would like to count the number of times person in column A has a particular entry in Column C that meets criteria of column D = Content but only count if column B is a unique value.
Using the below formula I can do everything except only counting unique numbers in Column B. I enter this formula in Sheet2 C2 then pull across to I2 then pull down to 6 in each column.
=IF(COUNTIFS(Sheet1!$A$2:$A$150,Sheet2!$B2,Sheet1!$C$2:$C$150,Sheet2!C$1,Sheet1!$D$2:$D$150,"Content")=0,"",COUNTIFS(Sheet1!$A$2:$A$150,Sheet2!$B2,Sheet1!$C$2:$C$150,Sheet2!C$1,Sheet1!$D$2:$D$150,"Content"))
I am using the double countifs to not show 0's.
Here is what it looks like for Sheet1
Here is how I would like Sheet 2 to look
Any help or advise would be much appreciated.
The answer by Vijayakumar works. In case you need a simpler version (without the data model option, use this formula in column E dragged down
=SUMPRODUCT(--($B$1:B1=B2))>0
Select all data
Insert ->Pivot table
In The Pivot table fields Move "SR" to Rows section "Stage" to column section "Prod" & "IsUnique" (Col E) to filter section and "QN" to Value section
Now right click on some cell in Pivot which shows sum/count of QN Summarize
values by -> Count
In the filter section of pivot (first row on
pivot table which states "Prod"), choose "Content"
In the filter section of pivot (Second row on
pivot table which states "IsUnique"), choose "TRUE"
When you have new data, you just need to Change Data Source from the Pivot Table tools->Analyze or Refresh. However you can record this whole process as macro to automate it.
You can achieve this via Pivot table.
Select all data
Insert ->Pivot table
In the pop up ensure you check the check box at the bottom with description "Add this data to data Model" and then click OK. This will create Sheet 2 for you.
In The Pivot table fields Move
"SR" to Rows section
"Stage" to column section
"Prod" to filter section
"QN" to Value section
Now right click on some cell in Pivot which shows sum/count of QN
Summarize values by -> More optins
In the pop up, scroll to bottom and click on "Distinct Count"
In the filter section of pivot (first row on pivot table which states "Prod"), choose "Content"
Note: Distinct count won't appear in values section if step 3 is missed out. Hope this helps.

Why is my Excel Power Pivot not maintaining the order of the manually re-arranged items in my ROW field?

I am using Excel 2013 and I have a PowerPivot which refreshes the data from an SQL database.
I have designed a pivot table from the data but I am getting really frustrated at one aspect of the design. I have dragged a field named "Room Category" in the ROW field, dragged a specific field in the VALUE field. I have then added another field as a Slicer, which is basically acting like a filter. I have re-arranged the "Room Category" field on my pivot table manually. However, each time I click on a different item in the Slicer and come back to the original item on the slicer, the order of the "Room Category" is set back to the default alphabetical sorting order!!
I have been looking for a solution all over the web but to no avail!
I am adding below an extract of the data that is being used to create the pivot table:
Property RoomCat Order
A2 X 2
A2 Y 1
A2 Z 3
B5 C 1
B5 D 4
B5 E 2
B5 F 3
So when I've created my pivot table, I have Property as a Slicer and I have manually re-arranged the RoomCat to show as follows for Property A2: Y,X and Z. I've done the same for Property B5 to show as follows: C,E,F,D
However, when I click on Property B5 on the Slicer and the click back on Property A2 on the slicer, the RoomCat for Property A2 now shows up as: X,Y and Z
The PivotTable will always sort alphabetically unless you give it something else to sort by. If you add a new field to your data which contains the sort order, then you can tell PowerPivot to use that as the sort order.
First Select your Room Category column, click on the Sort By Column button, then select the column that contains your sort order:
And the result:
I think I understand the issue (I've had the same problem with Dates as Text). I think if you create a "Named Set" based on the row Items, it will work.

Resources