Hello All,
I am hoping someone might know a way to calculate a YoY % Change that will switch over to a YTD over YTD on the recent Year so that it is not skewed doing the Current YTD over the Full Past Year.
I’m using a Row Header for Customers and a Column Header for Year, like this:
Here is my current Measure that fails when adding in the YTD ability I want:
YoY % with Current YTD =
VAR FYCurrentSales = [Gross $ -Cust Metric]
VAR FYPreviousSales = CALCULATE( [Gross $ -Cust Metric], DATEADD( '*Dates'[Date], -1, YEAR) )
VAR FYDeltaSales = FYCurrentSales - FYPreviousSales
VAR FYResult =
IF (
NOT ISBLANK ( FYCurrentSales ),
DIVIDE ( FYDeltaSales, FYPreviousSales )
)
VAR CurrentYear = YEAR(TODAY())
VAR SelectedYear = VALUES( '*Dates'[Year])
VAR YTDCurrentSales = [Gross $ -Cust Metric -YTD]
VAR YTDPreviousSales = [Gross $ -Cust Metric -YTD 1Y]
VAR YTDDeltaSales = YTDCurrentSales - YTDPreviousSales
VAR YTDResult =
IF (
NOT ISBLANK ( YTDCurrentSales ),
DIVIDE ( YTDDeltaSales, YTDPreviousSales )
)
RETURN
IF( SelectedYear = CurrentYear, YTDResult, FYResult)