How can I create a reference line that adjusts based on drop-down list selection in Google Data Studio? - google-data-studio

I have a bunch of key measure graphs, for this example, I will use the Safety key measures.
To add a goal line to a bar graph
I created a parameter called Safety Goal.
My data type is number (decimal),
my permitted values are Any values
my default value is 0.
On the Chart > Bar > Style > Reference Line #1
Type = Parameter
the rest is left to the defaults
Also created a inputbox with control field set as this parameter "Safety Goal"
This works if I type in a number in the input box, I receive my goal line.
How can I set this up to create a goal-line based on a selection in a drop-down list?
The Data Studio Minimal reproducible example can be found at this link
https://datastudio.google.com/reporting/3b476f9a-e79b-4421-b755-a086d9c8e7f5/page/LfniC
The data source link is https://docs.google.com/spreadsheets/d/1RJg16hWB_KfmTuDJAYgyrw_TVIK1LGRKY6qMGDE-5nk/edit#gid=1090568723
This link can be found on the Google Datastudio at the very bottom
chart>bar graph parameter settings:
parameter:
Control>input box settings when this number changes, the ref bar shows at that number which I call our "goal" I want this to work with the drop-down menu called Bay:

If you want to create a list of choice, you can do that if you create a parameter using the list of values and you enter your list of value manually.
If you want to use a list from a datasource and use that selection a the value for the reference line that is not possible within the same chart. You could create another chart, line chart, and show that line in front of your bar chart. But that would require that your Y axis are identical. You won't be able to use the auto Y axis, otherwise your 2 graph might end up with 2 different scale and your ref line will not represent the proper number on the bar chart.
To do this
you need a datasource with your goalline to be a different datasource than the one used in the bar chart. This datasource will contains two rows for each goaline value in the first column. the second column will contain the metric for the line. We want zero and a 1. for example
goaline
horValue
23.5
0
23.5
1
29
0
29
1
You will be filtering your result when you select within the drop down
you need to create your control dropdown list with your goalline datasource and choose goaline for your dimension
make that dropdown single select
create your bar chart and set the min and max for your Y axis
copy your chart and transform it into a line chart
for your dimension, choose horValue
for your metric create field choose goaline
in the style of the chart, for your series #1
for the line thickness choose "none"
hide data label
add a reference line
select type metric and choose goaline,calculation max
remove the legend
untick show axes and resize the chart area with your mouse in order to make sure the graph aligns with the one underneath
the problem with this is that you reference line will block your chart below. If wanted to use the data label card or total card the chart in front will prevent you to use it. You could have your ref chart behind the graph, the ref line chart will be slightly hidden from the bar chart in front.
Otherwise you could also use the area chart behind the bar chart to create the same thing, but I will let you figure this one out
I forgot to turn off the label of the ref line graph.

Related

Hiding a chart based on a condition in VEEML

I've got lots of items in a dimension and the display by default is really bad.
How can I show this chart only if the user select less than 5 items in that dimension ?
You could use a display condition on the object.
Open the setting window of the chart holding the click on the chart
Fill the change option button with a statement as below:
{"display_condition":{"condition":"COUNT(DISTINCT *your_dimension*)=2", "message":"Please select only 2 items of *your_dimension* to see the chart !"}}
Leave the message property empty to see the default message or just write a space if you don't want any message.

Use a relationship to filter data in power BI

I am working with a clustered bar chart that is influenced by a relationship to another table. When data is selected in that table I get the following result:
The dark green being the data that matches the relationship and the light green being the whole data set.
However, because sometimes the bars are very small, I would like to have the bar chart adjust to only include the data from the current selected relationship, as shown below.
Is there a way to limit the chart to only the data relevant to the current relationship? Alternatively, is there a way to filter out all values that are zero from the current relationship?
The way to do this is to click on the chart, go to the format tab, click on "edit interactions", and then click on the little filter icon at the top.

SSRS 2016 - How to display a chart, based on a condition, in the same page location

I am creating a SSRS Report (PPT export) with multiple charts and fixed number of pages. Each page contains multiple charts. I want to display different charts in the same page location based on a condition.
Now I know that ,we can Hide/Show a chart by specifying an expression for visibility attribute, but this will only Hide/Show the single type of chart in a preassigned location.
Just to reiterate
If Condition1=True
Display Chart1 at location (0,0)
Else
Display Chart2 at location (0,0)
Note: Chart1 and Chart2 are generated from different datasets
Thanks in Advance!
This is very simple to accomplish.
Create both charts and place them on top of each other in the report designer. Set up your visibility settings to only show one based on your criteria and as only one gets rendered, they will not interfere with each other or the rest of the report layout.
I Think position property for Chart is not available, so we can not manage chart position directly with any position parameter. but there is work around. create your all charts (multiple charts) in your report design, position them as you want and change their visible property as per your conditions.
e.g. if Chart1 to be displayed at position1 and position 2 based on condition, there will be 2 charts in your report RDL one at position1 and another at position2. manage each charts visible property as per condition, you should achieve what you need.
this is tried by me earlier.

How to display the Horizantal Access value from dataset field in rdlc report line chart

what property need to set the for the displaying this value in line chart in Rdlc report
Want to display right side capacity column value in line chart
It looks like you have specified interval and also the minimum and maximum limits so remove all those or set it to auto and it will come
Just try it
It's just configuration to show data in horizontal axis.
1) Goto rdlc-chart right on horizontal axis property click.
2) Goto Number tab.
3) Custom category -> click on custom formats (Fx).
4) Click on "fields" on category portion.
5) Click on databases field which one show as horizontal axis.

Limit data based on UniqueCount

I have charts on a tab, that should only show if 1 value from a column filter is selected.
For example if a field named: BUSINESS_UNIT has values of "HR","FIN","IT" The charts should only show data if 1 value is filtered on. Such as "HR."
These charts do not contain the BUSINESS_UNIT field itself.
I tried using the Limit Data Using expression, but for some reason the limit expression UniqueCount(BUSINESS_UNIT)=1 doesn't work.
How would I hide the data in the charts, unless 1 BUSINESS_UNIT is selected?
What you could do is hide the filters panel and create radio buttons on a new text area for each property to mark data. If you need help setting this up let me know. Then in your visualisations limit data using markings and show an empty visualisation if no items are marked.
One downside to this is maintenance, if the values change you will have to update the UI.
Another possible solution (untested) is to change the filter panel properties from checkboxes to radio buttons.
Filter Panel Properties:
http://stn.spotfire.com/spotfire_client_help/filter/filter_panel_properties.htm
You want it to look something like this:
http://stn.spotfire.com/spotfire_client_help/filter/filter_radio_buttons.htm

Resources