Hide Empty Zero Data Points in SSRS Line Chart - reporting-services

I have an SSRS line chart that I need to figure out how to hide empty data points - stop the line from making markers/continuing the line where Category Group values are zero:
The values and series and groups are setup as so:
With the data looking like this:
I have tried filtering both at the chart level and the Category Group levels to filter out data that would create groups for Series 2020 and Category October/November/December, this creating or filling those points in my mind:
Where the expression is "=DateSerial(YEAR(today()),MONTH(today()), 1)" achieving the net result of filtering out data points/rows that from an incomplete month - meaning when the report would be run on 10/10/2020, only data from before 10/1/2020 should be used to generate groups.

The problem is that you are using COUNT() which will always return a value, zero if there are no records to count.
I created a simple dataset and using count of FILE_NUMBER I got this (replicating your issue) ...
The easiest way round this is to change the value expression to something like this...
=SUM(IIF(Fields!FILE_NUMBER.Value = Nothing, 0, 1))
This way we add 1 to the sum for every non-empty value and nothing if it's empty. If the total sum is still empty, by default, the chart will not plot that point.
So we end up with this...

Related

Trouble creating nested SUM IIF expression in SSRS

I am new to SSRS and have a SUM(IIF question.
My data set contains four columns: Date, GroupID, PlanPaid, and NetworkIndicator.
Here is an example of the data set:
I am trying to SUM the [PlanPaid] amount when [NetworkIndicator] = "In Network".
However, I need this amount broken up by the [Date]. I tried accomplishing this by creating the expression:
=Sum(IIf(Fields!NetworkIndicator.Value = "In Network"
, Fields!PlanPaid.Value
, Nothing)
, "Claims_Rolling12")
But this expression returns the same amount (total) across all [Dates]. How do I break it up so that it is grouped by the correct [Date]?
Here is a photo of my Tablix and my current Groups: [Tablix and Groups]
And here is a photo of the output: [Output]
You haven't said where you want this sum to appear, so the answer here might not work. If it doesn't then edit your question to show what you expect the output to look like based on your sample data.
I'm assuming here that you want to add a new column to the report that shows "In Network total" by date.
The easiest way to do this is to add a row group that groups by date, then within this group you can use a simple expression, like the one you tried, but without specifying the scope.
=SUM(IIF(Fields!NetworkIndicator.Value = "In Network", Fields!PaidPlan.Value, Nothing))
This expression will only sum rows that are within the current scope, in this case the scope will be the row group you created to group by dates.
As IO said, if this is not helpful, edit your question and show what you expect your end result to look like, based on the sample data you supplied and then I can look at it again.

Cumulative data series displays error in a table in Power BI

I would like to display plan and fact cumulative data series in a dashboard with a bar and line combined chart and a table next to each other using Power BI Version: 2.59.5135.781 64-bit (2018. June) edition.
My DAX formula looks like this:
CUMULATIVE_FACT = CALCULATE(
SUM('FACT_TABLE'[FACT_VALUE]);
FILTER(
ALL('DATES');
'DATES'[YEAR]=MAX('DATES'[YEAR]) &&
'DATES'[DATE]<=MAX('DATES'[DATE])
)
)
Which works fine and gives a result as such (bars displayed as TÉNY refer to cumulative fact)
The cumulative plan (line referred to as TERV) series is identical to this but with plan figures. Also you can change the year so the aggregation only runs for the current year.
However, I would like to display either null (blank) or zero values for the fact series after a certain date which is given as a parameter. This parameter value is stored in a table with a single column and single row in a date type value.
So I modified my formula as such
CUMULATIVE_FACT = IF(VALUES('DATES'[DATE])<= MAX(PARAMETER_TABLE[PARAMETER_DATE]);
CALCULATE(
SUM('FACT_TABLE'[FACT_VALUE]);
FILTER(
ALL('DATES');
'DATES'[YEAR]=MAX('DATES'[YEAR]) &&
'DATES'[DATE]<=MAX('DATES'[DATE])
)
); 0)
The formula works fine for the chart but my table visual gives an error.
So the chart looks okay, perfectly the way I would like to display it, but the table gives back a 'A table of multiple values was supplied where a single value was expected' error message
Error message:
The column referred to in the message is basically the CUMULATIVE_FACT measure, I just changed it for ease of understanding. I tried with BLANK() instead of 0, but it looks the same.
No idea why it is not working with the table visual. Any ideas?
The problem is coming from this piece:
VALUES('DATES'[DATE])
This returns all values in the current filter context, not just a single one. That's why you're getting
A table of multiple values was supplied where a single value was expected
when you try to compare it to MAX(PARAMETER_TABLE[PARAMETER_DATE].
It works in the chart since VALUES('DATES'[DATE]) is always a single value that corresponds to the month on the axis, whereas the table has a total line that encompasses multiple months.
I think if you just turned off the total line, it would be OK. Otherwise, change VALUES('DATES'[DATE]) to an expression that returns a single date in the way you want. For example, MAX('DATES'[DATE]) might work.

Dont's show rows in SSRS

I'm trying to achieve my report displaying a "No Data Available" message if no results are returned in my query.
I am trying to achieve this via an expression against the Row Visibility.
So I have a Tablix that looks like this -
If there is data available then I want the third, fourth and fifth line to show.
If no data exists then I want the first two rows to display.....
In the Row Visibility for the first two rows I have the following -
=iif(CountRows("RentTransactions") = 0, true, false)
In the Row Visibility for the remaining three rows I have the following -
=iif(CountRows("RentTransactions") > 0, true, false)
I have a filter on the Tablix that just limits it to "AccountType" = Water.
When I run the report between 01/06/2016 and 30/06/2016 - I know there are not transaction - so would expect my report to return the first two rows....
It doesn't it returns the bottom ones , with no data in it??
What am I doing wrong?
The DataSet is definitely called RentTransactions
There are a few issues going on here.
CountRows with the dataset name will always return the total number of rows in the entire dataset.
Row Visibility will make the entire row blank, but it will still take up space. This would look bad if there are alternating blank rows.
What you're really trying to do is control what is displayed in each cell. So in each cell you'll want to have an expression that checks whether or not to display a value. For example, for the Description field it would look something like this:
=IIf(Count(Fields!Transaction_Type.Value) > 0, Fields!Description.Value, "")
This expression will work by returning a count of 0 for NULL Transaction Types. You can customize this if needed.
Also make sure that the query is returning rows for dates with no transactions. Otherwise there's no raw data for the report to do anything with in the first place.

SSRS Reporting multi value parameters

I have a ssrs report, that gives me multiple product's price. My Parameter is not drill down, I have to type in the parameters(since I have large range of product number).
Now my questions is, how can i get the last entered product ( parameter) always appear at the bottom of the report ?. This would help me where to look the latest product in the report.For example I have product numbers like:
abc-234,
abc-570,
ght-908,
Now what I want is that the latest entered product number which is ght-908 to appear at the bottom of the ssrs reports. Right now it gives me the report for the multiple product, but its all over the place and i have to squint my eyes and try to find out where my most recent entered product numbers (parameters) is. I have also tried to stop the parameters to being refreshed everytime i add a product number.
Assuming your parameter name is MyParameter, in report designer (BIDS) just drop a textbox onto report below the data (e.g. Table) and put following expression into its value's formula:
=Parameters!MyParameter.Value.Split(",")(Parameters!MyParameter.Value.Split(",").Length - 1)
it will split the parameter list and grab the last value
Update: here is the screenshot with steps:
And here is the runtime result
This expression works for me:
=Trim(Right(Parameters!Product_Number.Value
, InStr(StrReverse(Parameters!Product_Number.Value), ",") - 1))
Trim might not be strictly necessary but is useful as it will work if the values are split with spaces as well as commas, or not.
For example:
It sounds like you want to order the results of the stored procedure by the order of the product codes as they are typed into the report parameter (which is a comma separated list).
You can return the index (order) of each product code in the parameter by using the Array.IndexOf and Split functions, e.g.
If you have a report parameter called "ProductNumber" and you also have a field called "ProductNumber" returned in your dataset, the following code will return the zero-based index of the Product Number as entered into the parameter list:
=Array.IndexOf(
Split(Parameters!ProductNumber.Value.ToString(), ",")
, Fields!ProductNumber.Value
)
So if abc-234 is the first product number in the parameter list then this code will return 0. If abc-570 is the second product number in the parameter list then this code will return 1, etc.
Assuming the products are listed in a tablix, then I would set the tablix sort expression to the above, which should sort the products into the order specified in the report parameter.

Running Value Chart in SSRS - How to get each series to start at 0?

I have a table in SSRS, with income from two campaigns.
My columns are:
serialnumber
DateOfPayment
PaymentAmount
DaysSinceCampaign
Campaign
I want my chart to plot a running total of paymentamount by DaysSinceCampaign for each campaign (bs13 and bs12). I'm pretty close, as shown above - but for some reason, the BS13 campaign starts at 20,000, appearing to be adding on to BS12 - when it is supposed to start at 0.
In the Values section for Chart Data, I have used this formula:
=RunningValue(Fields!PAYMENTAMOUNT.Value,SUM,nothing)
I have tried changing 'nothing' to "campaign", and have tried defining 'Campaign' as a row group and a column group - but it keeps returning the same error: that the scope parameter must be set to a string constant equal to a containing group.
The scope here needs to be the name of the Series Group you set up in the chart, not the Column Group of the Tablix that is set up below, something like:
I created a simple test based on:
With the Chart data expression set to:
=RunningValue(Fields!PaymentAmount.Value, Sum, Nothing)
I got the following:
Which is incorrect, but similar to what you're seeing.
If I change the expression to:
=RunningValue(Fields!PaymentAmount.Value, Sum, "Chart1_SeriesGroup1")
I get the following:
Which is correct, so it seems like you're just going to have to set the Scope to the correct Series Group name.