Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
MattReinders
Contributor II
Contributor II

YoY Chart Expressions

Hello All, 

Need some help here. I am trying to do a YoY Chart.  My objective is to get Amount USD for the current year and the previous year. 

Here are my expressions for Previous Year and Current Year.  

Previous Year: =rangemax(Sum({<[FiscalYear] = {$(=vCurrentYear-1)} >}{<Description={'TD'}>}[Amount USD]))

Current Year: =rangemax(Sum({<[FiscalYear] = {$(=vCurrentYear)} >}{<Description={'TD'}>}[Amount USD]))

My Variables:                      Definitions: 

vCurrentYear                       =max([FiscalYear])      

vPreviousYear                     =$(vCurrentYear) - 1

My issue is that both expression are populating the same data.  For example, if year 2019 is populated, I get two chart lines with data for 2019 and do not get any data for 2018.

Please see attachment for a picture of what the chart looks like with these expressions. 

Appreciate everybody's help. 

Matt

 

1 Reply
sunny_talwar

Try this

Previous Year

Sum({<[FiscalYear] = {$(=vCurrentYear-1)}, Description = {'TD'}>}[Amount USD])

or

Above(Sum({<[FiscalYear] = {$(=vCurrentYear-1)}, Description = {'TD'}>} [Amount USD]))

Current Year

Sum({<[FiscalYear] = {$(=vCurrentYear)}, Description = {'TD'}>} [Amount USD])