Forum Discussion
Calculating Variance: Year on Year
- 9 years ago
To calculate the variance between current year and previous year for each account, you can create a calculated column and use EARLIER() function to get the previous year context for calculation. Please refer to formula below:
Variance = var PreviousYearType1=CALCULATE(SUM(Table1[Type1]),FILTER(Table1,Table1[Account]=EARLIER(Table1[Account]) && Table1[Year]=EARLIER(Table1[Year])-1)) return IF(PreviousYearType1=BLANK(),BLANK(),Table1[Type1]-PreviousYearType1)
Regards,
To calculate the variance between current year and previous year for each account, you can create a calculated column and use EARLIER() function to get the previous year context for calculation. Please refer to formula below:
Variance = var PreviousYearType1=CALCULATE(SUM(Table1[Type1]),FILTER(Table1,Table1[Account]=EARLIER(Table1[Account]) && Table1[Year]=EARLIER(Table1[Year])-1)) return IF(PreviousYearType1=BLANK(),BLANK(),Table1[Type1]-PreviousYearType1)
Regards,
so i have this data in which one column is year and the other column is sales
Year Sales
2014 332332332
2015 23223232
2016 2132321332
2017 219389323
now i have to calculate the rate of change of the sales from one year to the other
the data type for year is Number
sales is revenue
how do i do it
- Anonymous9 years agoNot applicable
Use the Earlier function in DAX, before that sort the year.