0

I build a line chart wherein x-axis need to show only start date and end date while removing the middle dates. So I have achieved that by the scalar expression.

=datediff("d",first(Fields!Date.Value),last(Fields!Date.Value))

However, when the start date and end date is the same for eg: 11-20-2018 then the x-axis shows 11-20-2018 multiple times and 11-21-2018(which is not an end date) where i need to show it only once. Please suggest how to achieve.

This is what is required

X

James Z
  • 12,209
  • 10
  • 24
  • 44
ashishsingh.9x
  • 152
  • 1
  • 1
  • 16
  • 1
    I don't see much difference in your pictures. Am I just blind? – James Z Nov 19 '18 at 19:56
  • Possible duplicate of https://stackoverflow.com/questions/40591370/ssrs-data-label-on-first-and-last-entry – Strawberryshrub Nov 20 '18 at 07:49
  • @JamesZ question edited. There was a duplicate image attached. Apologize for that. – ashishsingh.9x Nov 20 '18 at 11:54
  • @Strawberryshrub this is not what im exactly looking for! – ashishsingh.9x Nov 20 '18 at 12:00
  • Does it help when you go to your `Horizontal Axis Properties` and set the intervall to `1`? – Strawberryshrub Nov 20 '18 at 12:42
  • @Strawberryshrub Initially the value was 1 but what happens in that for example if i select 11/01/2018 to 11/10/2018 then in x-axis all date is coming from 1 to 10 but what i needed was to show only 01 and 10 November so with this expression in interval i achieved it but now what is happening(problem) if i select same start date and end date for example 11/20/2018 then on x-axis it shows 11/20/2018 multiple times which does not make sense and in last it shows 11/21/2018 which also does not make any sense. Hope you are clear now and can help. – ashishsingh.9x Nov 20 '18 at 15:51
  • @JamesZ removed only one but both got removed. – ashishsingh.9x Nov 20 '18 at 18:24

1 Answers1

0

I think there are two ways what you can do.

First one would be to use just one parameter (with the option to allow multiple values). So just the dates you chose from the parameter would appear in the chart.

Second one would be to use a filter in your chart. Go to your Chart Properties > Filters and add the following filter:

'Expression
=IIF(CDate(Fields!YourDate.Value) = CDate(Parameters!YourFirstDate.Value) Or CDate(Fields!YourDate.Value) = CDate(Parameters!YourSecondDate.Value), True, False)

'Format
=Boolean

'Value
=True
Strawberryshrub
  • 3,301
  • 2
  • 11
  • 20