Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

SamePeriodLastYear error

Hi All,

 

I am doing a headcount report and would like to use the SamePeriodLastYear function to calculate last year headcount, however, the results are wrong and the numbers look strange. Any ideas?

 

 

 

 

 

6 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Anonymous

     

    In the Table Visual, are you using the Month column from Calendar table?

    • Anonymous's avatar
      Anonymous
      Not applicable

      i am using the "Month" in Calender table as the row content.

      • v-piga-msft's avatar
        v-piga-msft
        Resident Rockstar

        Hi Anonymous,

         

        What about use the formula below?

         

        py =
        CALCULATE (
            SUM ( 'Table1'[Headcount] ),
            FILTER ( 'Table', YEAR ( 'Table'[Date] ) = YEAR ( MAX ( 'Table'[Date] ) ) - 1 )
        )
        

        Here is the output.

         

         If you still want to use Time Intelligence functions for your case, please share some data sample and the relationship between the tables.

         

        Best  Regards,

        Cherry