Power BI How to filter report by value in column - filtering

I just want to ask if its possible to filter value base on the value in a column.
I want them to show it categorized by the Tier Column, but what happening is that it shows all the data the same as each other.

On each of those four bar charts, you can set a visual level filter corresponding with the tier you want to show.

Related

Tableau - KPI (Forms) using different variables

Im trying to perform a KPI on Tableau based on the rank of certain variables such as sales and profit as the excel example below
KPI = If the country position (using rank formula on Tableau) is on TOP 3 = GREEN; TOP 5 = YELOW; OTHER = RED. As the second table shows
On Tableau, I would have to create 2 calculated field KPI_SALES & KPI_PROFIT following the logic above
The ideia is to use the forms with the 2 calculated fields created above, however, the problem it that Tableau only allows to use one variable on forms which is my problem, i will have to use 2 variables on this example
There is any other way to accomplish it?
Yes, you can do this. Go to each sheet and click on the Label Card in the Marks Shelf. Then click the box that says "Allow labels to overlap other marks". See picture.
I have solved the problem by creating fake columns such as sum(0)
so each card would allowed by the chose different variables to put on marks as the picture below shows

Graph based on the user filter selection

On a tableau dashboard there are 2 filters and a bar graph.
The filters are 1. to select top or bottom customers
2. how many ex:5,10,15 etc
when the user selects top and 5 in the respective filters then top5 customers have to show in the bar graph.
if the user selects bottom ,10 in the respective filters then bottom 10 customers have to shown in the graph.
how to achieve this when the data contains only customers details and their billing amount ?
Instead of filter, you can go with the Parameter for getting the result. I have done the top and bottom multiple times in many of the tableau visualizations and its so easy.
Below are the steps to achieve your requirement.
Create a parameter that will allow you to select top and bottom
Create another parameter that will allow you to select the desired numbers like 5, 10, 15 etc.
Here i have created a parameter that will have values from 10 to 50 in a step size of 10.
Create a calculated field that will subset data based on the parameters chosen
In the above screenshot, I am using the top site parameter and creating a conditional statement that will show the states based on the value chosen in the site parameter and the value for that state.
Put the calculated field in the filter and select show and click ok in the filter box.
Now the view will show the top count based on the value selected in the parameter.
Please note the calculation is for top N and for bottom N you need to change the calculation.
Hope this will help you. I can provide you a workbook if you need.

Can you add data to a Cognos 10 bar chart?

Is it possible to dummy code a number to appear in a bar chart in Cognos? I am looking at department expense totals for 2015 and 2016 and want to put a 3rd bar for what the budget for the department is. This data is not loaded into our data warehouse though so I am searching for a possible work around.
Thanks!
If you to have one set of bars, then you have to use a union:
Create a new query
Add a new data item to hold the budget value
Add 'dummy' versions of all other columns. The data types have to match your existing query
Make sure that the order of all columns matches up with the order of the original query
Union your new query with the original query
Use the query representing the result of the union as the source for your chart
Another option you have is to use a baseline to represent the budget. Instead of a separate bar, you have a line that goes across the whole chart at the budget value. Baselines can be configured under the Chart Annotations section of the chart properties sheet.
Lastly, you can choose a chart type that accepts multiple measures.

Show calculated measure in row?

I'm using Tableau Desktop 9.0 on OSX. I have data (loaded from a local CSV file) that looks like this:
code,org,items
0212000AA,142,10
0212000AA,143,15
0313000AA,142,90
0314000AA,143,85
I want a chart that shows the number of items beginning with 0212 as a percentage of all items, for each organisation. (I mean as a percentage of the organisation's items - for example, in the above, I would like to show 0.1 (10/(10+90)) for organisation 142.)
I have been able to get part way there, by adding org to Columns, and SUM(items) to Rows. Then by adding a Wildcard filter on code, for starts with 0212.
This shows me the number of items starting with 0212, by organisation.
But what I don't know how to do is show this divided by the value of all items for the organisation.
Is this possible in Tableau, or do I need to pre-calculate it before loading my data source?
One way is to define a calculated field called matches_code_prefix as:
left(code, 4) = "0212"
You can also define a parameter called, say, code_prefix to avoid hard coding the prefix string:
left(code, 4) = code_prefix
And then show the parameter control for code_prefix to allow the user to interact with it.
If you use this new field as a dimension to separate SUM(items) according to those that match the prefix and those that don't, you can then use a quick table calculation to get the percent of total.
For example, you can place org on the Rows shelf and matches_code_prefix on the Columns shelf, and SUM(items) on the Text shelf to make a table. Then under the analysis menu, turn on grand totals for both rows and columns to see the behavior. Next, right click on SUM(items) and choose Quick Table Calc->Percent of Total. Tableau will display the percents of total in the table.
If you want the percent of total defined differently than the default, then right click on the measure again and set Compute Using to a different value such as matches_code_prefix in your case. It's usually better to set compute using to a specific field.
If you only want to display the value for the matching case, select the column header you don't want to see and choose hide. You can also turn off the grand totals from the analysis menu when you are done.
When you are confident in the values in your table, you can turn it into a bar chart for example by moving matches_code_prefix to the detail shelf and the measure to the Columns shelf.
--
The above is the drag and drop approach. If you prefer to hard code everything in a single calculated field that is calculated on the database side, you could instead define a calculation such as:
zn(sum(if matches_code_prefix then items end)) / sum(items)
Then set the default number format for that field to display as a percentage

Group by first two characters of column, in Tableau?

I'm using Tableau Desktop v9.0. I have data that looks like this:
code,items
02050252,7
03040620,19
03060423,3
I want to create a bar chart of the items grouped by the first two characters of the code field.
So effectively a chart that shows this underlying data:
new_code,items
02,7
03,22
Is it possible to do this within Tableau? Or do I need to group the data manually myself first?
You can definitely do this within Tableau.
Make sure that your code column is a string. If it's not, right click on it in the dimensions section and choose Change Data Type.
Then, create a calculated field (Analysis -> Create Calculated Field) and enter the expression LEFT([Code], 2), which will take the first two characters of the code field.
Drag your new_code field to the Rows shelf and Items to the Columns shelf and voila, you have your desired data. You can of course change the type of the chart, make it a table, etc. from here.