SSRS Chart: Add a Baseline - sql

I try to put in SSRS in a chart bar a target line and a baseline. I add in my chart with stripline a target line. But I would like to show it like this:
The chart1 is the chart which I would create in SSRS. And the chart2 is the chart which I create in SSRS. How can I add only one bar at the beginning of the chart.

I assume there is a parameter or equivalent identifying where the Baseline should be (even if it is the current date)
If so, you can have the baseline series to only display a value for the column you want to set as the baseline.
In this example I have a number of students, and want to display a baseline column where the student name is Student1
Add a new series to the chart, and set the expression to be
=iif(Fields!Student.Value = "Student1", Sum(Fields!Val.Value), 0)
This will mean that it will only return a value when the column is for Student1, otherwise it will return zero.
Conversely, you could set the other columns to be values except for when they are Student1 as follows
=iif(Fields!Student.Value <> "Student1", Sum(Fields!Val.Value), 0)
Using a Stacked Column chart for these series would give this output
Alternatively, you could use dates for the X axis, and use a parameter to set the date for the baseline, and use a expression such as this to identify the baseline column
=iif(Fields!myXAxisDate.Value = Parameters!myBaselineDate.Value, Sum(Fields!mYValue.Value), 0)
Hopefully this will assist you. Please let me know if you have further questions on this.

Related

how to bing the grouped items to a non group section of a tablix

I need to have a graph the same size as tablix. Since i cant merge the cells , how can i bring the grouped items to the left ?
i have this
Before
and i want it to look like this:
After
But since the period is a group i cant merge the cells in the bottom, So is there a way to bring period colums to the left.
Thanks
If your chart and table use the same dataset (and why wouldn;t it if it showing the same data), you can put them in a list that will grow with the column grouping of your current table.
INSERT a new List. A list is really just a table.
Add an extra row to the list in the same group.
Set the Grouping on the list to Group By 1 (the number one). This will group everything to one line.
Set the dataset to the same dataset as your chart and table.
Set the list's top cell's size to match your table.
Put the table in the top row.
Set the bottom cell to the height of the chart.
Put the chart in the bottom.
The column grouping in the top will stretch out the list and the chart will go with it.

Suppress zero values in Power BI Line graph

I am attempting to make a graph that has one column with a full month of data (black bars), and one column that fills up as the days of the month progress (green bars). I would also like to track the percentage of the forecast achieved each day as a line graph (red line) on the secondary axis.
The problem I am having is that it does not appear that one can exclude values that are zero. So in the graph I would like to have the red line disappear once the values become zero so that there isn't a massive drop of like in the image shown.
To fix this problem I inserted a blank spot if the condition is true. That is a "" after the 'then' statement to force a NULL. After this I changed the data type to percentage.
The code is shown below and the resulting graph is shown afterwards.
= Table.AddColumn(#"Filtered Rows1", "AdjDiff", each if [#"%difference"] = 0 then "" else if [#"%difference"] <> 0 then [#"%difference"] else null)

Dynamic background color for total cell

I'm using Pentaho Report Designer and I would like to change the background of the cell that contains the sum of all the measure values of a column based on the calculated value. For the measure values, this can be easily done defining a formula for the background property like the following one:
=IF([measure] >10; "red"; "green")
However, from the cell that shows the total, [measure] is always null.
How can I get the value of the cell (or the result of sum all the measure values)?
Thanks
Finally I've found how to do this. It is necessary to create a function to sum the values so it can be referenced later from a formula:
Create a function to calculate the total (Add Function... > Summary > Sum)
Inside the properties table, select Field Name for the function. Give it a Function Name to make reference to the formula later (i.e. budgetTotal)
Use the function to apply the conditional formatting based on its value (i.e. =IF([budgetTotal] >10; "red"; "green"))

Dynamic reference in excel formula

I have the following array formula which works for what I want to do but I'm trying to change the formula when a user selects a value.
=INDEX($A$2:$B$70,SMALL(IF($A$2:$B$70=$A$121,ROW($A$2:$B$70)),ROW(1:1))-1,1)
It's used for a monthly report and the user will choose from a drop down the day of the month, e.g 1,2,3 - 31.
So if the user selects 1 from the drop down menu I want the formula to use the above formula.
If they select 2 for example I want the formula to move over a column so it would change to
=INDEX($A$2:$C$70,SMALL(IF($A$2:$C$70=$A$121,ROW($A$2:$C$70)),ROW(1:1))-1,1)
and so on moving over a column at a time.
It this possible at all or can it even be done without VBA?
I have an example of what I want done on the following link
https://docs.google.com/spreadsheets/d/1MDOzoQxYLgW-UOyljZsMwSu8zyAB7O2k1V-bTNP5_F0/edit?usp=sharing
All the data is on the first tab called staff. Each employee has a row and the duty assigned under the corresponding day column.
On the Roster tab it summarises each day. So what I am trying to get to happen is when you choose the day of the month (or preferably the actual date) the sheet changes to reflect the data.
At the moment the code I have working does for just Day 1 because the column references are coded into the formula. I was hoping to somehow choose 6 for example from the drop down and then the formula will map chosen day to the corresponding range in the raw data and update the formula and change the formula from Staff!$A$2:$B$68 to Staff!$A$2:$G$68.
If the formula finds no more entries if shows #NUM! but I intended to use the function ISERROR() to replace #NUM! with "".
This is what I'm trying to achieve it if makes sense?
There are a few issues here/ You are returning the value from column A so the first range can be $A$2:$A$70 and that means you don't need the 1 to specify the column_num. The IF statement was covering A2:C70 when you really only want either B2:70 or C2:C70 depending on the 1 or 2.
Assuming that A122 has either a 1 or 2 in it then,
=INDEX($A$2:$A$70, SMALL(IF(INDEX($B$2:$C$70, 0, $A$122) = $A$121, ROW($1:$69)), ROW(1:1)))
Standard non-array alternative,
=INDEX($A$2:$A$70, SMALL(INDEX(ROW($1:$69)+(INDEX($B$2:$C$70, 0, $A$122) <> $A$121)*1E+99,, ), ROW(1:1)))

Multiple charts in an report for a specific column value

I need to display multiple charts in an SSRS-Report. With multiple charts i don't mean multiple series in one chart area - i mean for each value a new chart area with an own chart. I don't know if this is possible but i'll give it a try :).
The data source is a table containing multiple rows and columns. One column contains a value containing the material no. Now i need to create a new chart for each material no. in this data table. The whole thing should look like this:
The number in the brackets is the material no. As you see i need to create one own chart for each material no. Is this possible?
Important: The material no. can exist multiple times in the data table but only one chart should be displayed for one material no. The values which belong to the specific material no. will be aggregated
Update #1:
First a screenshot showing the data the data source returns:
The expression for the hiding looks like this:
Table 1
=iif((RowNumber(Nothing) Mod 2) <> 0 AND (RowNumber(Nothing) Mod 3) <> 0, False, True)
Table 2
=iif((RowNumber(Nothing) Mod 2) = 0, False, True)
Table 3
=iif((RowNumber(Nothing) Mod 3) = 0, False, True)
Here is a screenshot of the three tables inside the report.
All three tables display the material no. They are all bound to the same data source with the row visibility expression posted aboth. The group expression for the row looks like this (typeMaterial is the column yieldTypeMaterial):
At the end, it results in this:
We can achieve this by putting the chart in table list and group the row by "Material No." and design the chart as per your requirement. By this, 1 chart will be displayed per row, but not as per your screenshot.
(I think below given is not a great idea, but we can try that).
I guess, to display as per your screenshot take 3 different tables, place them side-by-side and write filter conditions such that to hide some rows in table1(Ex. Display row no.'s in "table1" 1,4,7,10), display some rows in table2(2,5,8,11) and in Table3(3,6,9,12) as described in this answer about faking multiple columns with tables.
Use below expressions for 3 Tables:
Table1
=iif((RunningValue(Fields!TypeMaterial.Value ,CountDistinct,Nothing) Mod
2) <> 0 AND (RunningValue(Fields!TypeMaterial.Value ,CountDistinct,Nothing) Mod
3) <> 0, False, True)
Table2
=iif((RunningValue(Fields!TypeMaterial.Value ,CountDistinct,Nothing) Mod
2) = 0, False, True)
Table3
=iif((RunningValue(Fields!TypeMaterial.Value ,CountDistinct,Nothing) Mod
3) = 0, False, True)