Adding a row subtotal for certain columns only - tableau-api

I have data as shown in this table:
If I add a grand total column Io get sales and units across the window.
Is there a way to add a row total for only Contract Owners AAA and BBB? But not CCC & IDN?

Arrange your data on the sheet as shown on the screenshot (using Measure Names and Measure Values), display subtotals and then use the individual measure pills to hide subtotals for selected measures.

Related

Power Bi Clustered Column Chart to show % or row total

I am using Power Bi to produce several reports, one of it is the NPS score for support. However, I am coming across an issue with the clustered column chart. It is showing the value against the total number rather than for each row.
What I want to see if the following (within Excel),
The NPS score is shown as a percentage for each week.
e.g. Week 3 has the Promoter at 95.5% and Detractor at 4.5%
However, when using Power Bi, I am shown the following, which is a Percentage of the grand total, instead of each week.
Using a Matrix, I could see the following as total numbers.
I can copy this Matrix and show it as a Percentage of each Row, which is also correctly showing the results.
I have the dates already set up using a feeder table to allow me to get the week number etc from a date within the main raw data, so they sort in the correct order..
My Chart is using the following table entries
Cal Week and WeekNo are both from the feeder table (Fiscal)
Net Promoter and Count of Case Num are from the RawData table.
How can I get the chart to show the percentages per week instead of the total?
I am also planning to use slicers to filter down further, for example, Regions (which are in the RawData).
I believe I will need to add an extra column to the RawData, but no idea what to put in it and then how to use that in the chart, and still allow it to slice.
Any help would be greatly appreciated.
Thanks
DD

Grand Total for discrete column

I am new to tableau and trying to show grand total for discrete columns however it shows blank. Is there a workaround. Can one total for discrete columns?
Here's the snapshot:
I tried to follow tableaus notes and removed the discrete columns and double clicked it , however it becomes continuos and tries to aggregate it. Is there a work around?
Please help
You can't grand total a discrete column. It either has to be continuous OR you create a WINDOW_SUM calculation to calculate the grand total, then put the total in the Title area instead of within the table.
An easy way is to move your discrete measure from the Rows shelf to the Text shelf and then make it continuous. If you have multiple measures, you can get a similar effect with the placeholder fields Measure Names and Measure Values

Side-by-side bar chart: One with the current filtered selection and one for total

I calculate the percent of total number of active customers for each SalesOwner in one of my Workbook sheets:
As you see, I have also added the SalesOwner as a filter.
The calculated field (segment_active_members) is computed using the following formula:
COUNTD(wk_customer)/ SUM({FIXED : COUNTD([wk_customer])})
What I want to do is create a side-by-side bar chart where upon filtering one of SalesOwners, I am able to compare it with the total (100%). So if I filter the above sheet by SalesOwner X which takes 5% of total. I'd like to see only two bars with one having 5% of the other one's length.
So I add another calculated filed to the above scenario where a fixed total is calculated:
SUM({FIXED : COUNTD([wk_customer])}
We will have a new column in the above picture with a fixed value of 100% for all rows.
I get what I want when my filter is on "All".
But as soon as I select a single filter (SalesOwner), my first percentage is also changed into 100% and I can never compare it to total.
How can I show the percentage against total for single segments?
This could be one of the solution:
Change the calculation of segment_active_members as follows
SUM({FIXED [Sales Owner]: COUNTD([wk_customer])})/SUM({COUNTD([wk_customer])})
Remove the table calculation for segment_active_members in the Measure Values shelf
You'll see that you are able to filter it down without any problem now
Cheers!

How to use Grand total for multiple column in tableau

I have one table with three columns say c1,c2 and c3. I want to show grant total for all three columns. I have tried but grand total's logic was working only with column and not for three column.
So is there any way to do so..
If all three columns are measures then you should be able to just go to Analysis->Totals->Show Column Grand Totals.
Or are you also trying to count a dimension? Your question is not very clear.

Tableau - Comparing one against an average of many on same worksheet

I'm looking to compare a single Fortune 500 company's revenues (selected by the end user from a list of all Fortune 500 companies) to an average revenue for all Fortune 500 companies over time. I would like the averages to show up as bars and the single company revenues to show as a line graph (both on the same chart).
I understand how to set two different chart types on the same view. What I don't understand is how to write the calculations and parameters to give the end user the functionality of choosing a single company and comparing it against all others.
Any suggestions on how to do this? Happy to clarify further if needed.
Thank you in advance!
I don't have Tableau right now to test, but I believe that kind of chart can be achieved using 2 measures.
Well, you need to create the measures then. The average of all is pretty straight forward, it's AVG(Revenue).
The single company revenue can be retrieved using parameters. Create a parameter like [Company chosen], and put the list of all Fortune 500 (you can load from field, which helps a lot).
Then create a calculated field [Company revenue]:
IF [Company] = [Company chosen]
THEN [Revenue]
END
And just use the sum or avg of this measure.
Put both the measures on the worksheet and set the right chart
I am using the superstore data that ships with Tableau.
You can create an LOD calculation to calculate the average:
SUM({FIXED [Order Date (Months)] : SUM([Sales])}) / SUM( {COUNTD([Sub-Category])})
This is calculating the total sales at each month and summing the sales and then dividing that by the number of points for each month (thereby giving you an average of sales per month).
FYI, I submitted this question to Tableau. They replied with a workbook using the Superstore data with the following instructions:
Add Year(Order Date) to the column.
Add Sales to the row.
Create a parameter called Select Country with the following settings:
Name: Select Country
Data Type: String
Allowable Values: List
Add from field: Country/Region
Select OK.
After creating the parameter, Right Click on the parameter in the data pane and select Show Parameter Control.
Create a calculated field Country Sale called with the following formula:
IF [Country / Region] = [Select Country] THEN [Sales] END
Add Country Sale to the Rows Shelf.
Go to Sum(Country Sale) tab on the Marks Pane and select Line from the drop down.
Right Click on the Country Sales axis and select Dual Axis.
Right Click on the Country Sales axis and select Synchronize Axis.