Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text in Chart: Display Last X-axis Data Point

Hi,

I am brand new to this so I apologize if this has already been posted - I've read through a couple posts already and have not been able to understand to solve my problem.

SC_SS.PNG

I am trying to get YTD to show the most recent value - 88% (only value, not sum). Originally I had put in the Text in Chart:

='YTD:'&only(ServiceCoverage)

But I realized without selecting the month, it does not know which value to choose, but I would like it to display the last data point on the x-axis that contains data. Going forward in 2014, in February, we will be talking about the January data - where only January would have data and the rest of the year will be 0... going onto March, we will have January and Feb data, but I only want it to display Feb data.

I tried using the max function too, but it returns the max Service Coverage point (which in this case gets me the December number) but I have other charts where the last data point is not the highest value. Is there an expression to pull the Y-axis value for the max X-axis value?

The other solutions I have read involved pulling from today's date or choosing a specific date as today's date, and I would like to stay away from that if possible - I just want the last x-axis Y-value (that is not 0) to display.

As I have the personal edition, I am unable to view other .qvw files and would appreciate the expression in text on the forum .

Thanks!

12 Replies
Not applicable
Author

Hi Nicole,

Sorry to keep bothering you on this. I've finally changed the format to a Date format (with year.. I originally had a separate Column for that)..and I've set the x-axis to Date. Per your suggestion, I've put the following into the Text in Chart and I still can't get it to pull the last value.

 

='YTD:'&only({<Date={'$(=date(max(Date)))'}>}[Service Coverage - All (%)])


And when I put sum instead of only, I get 0.00

Thanks again.

Nicole-Smith

It has to do with your date format.  The date() function isn't needed inside the set analysis:

='YTD:'&only({<Date={'$(=max(Date))'}>}[Service Coverage - All (%)])

Not applicable
Author

Thank you so much!!!