Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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])