Forum Discussion

Zwakele's avatar
Zwakele
Frequent Visitor
9 years ago
Solved

Compare Current and Previous Year

I'm clueless where to start. I'm happy to provide more info. needed.

I have a report I want to show current year by month (total) and I want to compare values with the previous years by month.

 

On Excel, I used the Value Field Settings to show values as Difference from Based field [Year] and Base items [next]

 

  • Anonymous's avatar
    Anonymous
    9 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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    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