Forum Discussion
Compare Current and Previous Year
- Anonymous9 years ago
Hi Zwakele,
You can take a look at below sample.
Table: Date,Amount.
Add a measure to calculate previous data.Pervious Year Total =
var currDate=MAX([Date])
return
SUMX(FILTER(ALL(Shipments),Shipments[Date]>=DATE(YEAR(currDate)-1,1,1)&&Shipments[Date]<=DATE(YEAR(currDate)-1,12,31)&&MONTH([Date])=MONTH(currDate)),[Total Revenue])Improve % = FORMAT( DIVIDE(SUM(Shipments[Total Revenue])-[Pervious Year Total],[Pervious Year Total],0 ),"Percent")
Create a matrix to show the result.
Regards,
Xiaoxin Sheng
Hi Zwakele,
You can take a look at below sample.
Table: Date,Amount.
Add a measure to calculate previous data.Pervious Year Total =
var currDate=MAX([Date])
return
SUMX(FILTER(ALL(Shipments),Shipments[Date]>=DATE(YEAR(currDate)-1,1,1)&&Shipments[Date]<=DATE(YEAR(currDate)-1,12,31)&&MONTH([Date])=MONTH(currDate)),[Total Revenue])
Improve % = FORMAT( DIVIDE(SUM(Shipments[Total Revenue])-[Pervious Year Total],[Pervious Year Total],0 ),"Percent")
Create a matrix to show the result.
Regards,
Xiaoxin Sheng