Google charts -- different x-axis label and data label - google-visualization

I am using Google Charts to display some statistics. I'm using column chart. Each column has a label, which is a very long string. This label is displayed as x-axis label and also when I hover over the data column. What I would like to do is to keep this long label displayed when hovering over the column but display just ID on the x-axis. For instance:
ID | Name | Value
1 | Some long label | 3.0
I want the "ID" as x-axis label and "Name" to be displayed when hovering over the data column. "Value" is the actual data. Is it possible to do this? I wasn't able to find this in the Charts documentation.

I think you can use DataTable roles and in your case the tooltip role that is supported but the column chart.

Related

How to make PowerBI redraw the chart based on a legend is selected

I have a table in PowerBI as my data source.
Table
| Time | type | count | environment |
And I have 2 charts for that table.
Line chart (x axis is Time, y axis is sum of count, legend is type)
Stacked column chart (x axis is Time, y axis is sum of count, legend is environment)
My question is when I select 1 legend in the line chart, the Stacked column chart get redrawn. The values of the selected legend is drawn with normal colors but other values is still shown as 'faded' color.
i.e. something like this
Can I make the stacked column chart to be redrawn so that the values only shown the legend which was selected in the line chart.
That's called cross filtering. If you want full filtering put the legend into a slicer next to the column chart und you'll get the desired effect.

Power BI - Bar chart with one bar per logical column in table

I have a table of things, and multiple true/false columns of attributes for that thing.
I want to make a bar chart with one bar for each attribute, and the value being a count of Thing IDs where the attribute is TRUE:
I'm sure it's simple but I'm having trouble, and I'd appreciate any help.
In the Power Query editor, you can pivot the columns of the attributes.
Select the attribute columns and click on tab transform on Pivot column.
you will get:
ThingID | Attribute | Value
then you can add a conditional column to count the TRUE.
If value equals TRUE then 1 else 0
Then make a chart in PowerBI and your Axis is the Attribute column and the Values is your count column and your there.

How to customize tooltip and slicer values in power bi?

I am unpivoting few columns which are extracted from a Date field, to show as a radio button in the slicer.(fields are: "Daily", "Yearly", "monthly", "quarterly")
Qs.1: Can I show these values in a custom order like: "yearly", "quarterly", "monthly", "Daily"
Data format( I have used the "Attribute" column in the slicer to achieve the radio buttons)
Qs.2: To sort the x-axis I have used the main date field("app_submitted_date) on the tooltip.
If I don't use the "app_submitted_date" on tooltip will not be able to sort x-axis when "quarterly" & "monthly" is chosen.
While using the "app_submitted_date" filed on tooltip I am getting the tooltip in the following format:
How to customize the tooltip so that it will only show ( Female: count, Male: Count, Not Disclosed: count, Date: whatever date it is)
Please let me know for any clarification in the question.
Qs-1 Solution
Create a small table with two columns & 4 rows :
Attribute Names
Index
as follows :
| Year | 1 |
| Quater | 2 |
| Month | 3 |
| Daily | 4 |
Then, create a 1 to many relation between this table and the table that you showed in the question (Attribute to Attribute connect).
Then, instead of take the contents of this attribute column as a filter and prior to that sort this attribute column by index in the "Table View".
Qs-2 Solution
For this solution, I agree with the answer provided by Jon. There is no way to hide the thing that you have taken in tool tip; as of now.
Formatting the tool tip directly as you have suggested cannot be done, however there is a work around with 'Tool Tip' pages, that may help you show what you need.
You create a new page, with the measures in, this is then displayed as a tooltip over your data. Image taken from the MS Docs website

sorting stack bar chart in power BI

I am using a stacked bar chart for presenting the gender ratio in various region.
here the legend is gender and Axis is region and value is headcount.
when i want to sort the chart according to female gender value . the sorting is only done by the headcount value. how can i sort it for the percentage value. please help me.
EDIT: My first answer focused only on count, now I've taken into account that OP wants to sort by percentage female value
You can sort your data directly in your Stacked column chart visualization, after pivoting the data and adding a column showing the female percentage value using the Power Query Editor. If you insert the female ratio as a Tooltip, your chart can be sorted as that value even though it is not displayed in your chart.
Here are the details:
This data sample should fit your description:
Region,Gender,Count
USA,M,9000
USA,F,7000
EU,M,5000
EU,F,5000
UK,M,2000
UK,F,4000
CAN,M,100
CAN,F,900
If you enter that data using Edit Queries / the Power Query Editor, you can set it up like this:
Now highlight the Gender column, and select Transform > Pivot Column to get this:
Under Values Column, select Count and click OK to get this:
Now simpy add a custom column to calgulate the female ratio like so:
Now your table should look like this:
In the desktop, insert a stacked column chart and set it up like below. Notice that you'll need to insert F ratio under Tooltips:
Now you can sort your chart by Ascending or Descending F ratio

Power BI - How to format missing data in chart, I want to display this blank data in chart

Please see below screenshot. There are values in the table (highlighted in red) that are not reflected in the above chart. How do I get this blank data to display in the chart?
The sr_temperature values that are not appearing on your chart have blank (or missing) values. Blank is generally treated as "no data" rather than 0, so it doesn't get displayed on the chart at all.
If you want those values to display in the chart, you have to either:
Add a timestamp record with a value for sr_temperature - if there is no sr_temperature record at all for that timestamp
Substitute the blank with the sr_temperature that you want that time to have (such as 0, as #teylyn suggests) - if there is an sr_temperature record for that timestamp already, but the value is BLANK()
How you do that will depend on how the data is being loaded into Power BI (as #Nick.McDermaid says).