Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Measure for Previous Year's Data

Hello!

 

I have a question that I think will be simple to answer, but I can't seem to figure out the correct solution.

 

I have a variable, Year, as a slicer on my dashboard. 

 

I have already created a measure called Cost per Client which was done by doing Cost per Client = DIVIDE(SUM('Table'[dollars paid]), [Client Count])

 

I am wanting to also display Cost per Client for the previous year, but want to keep my Year slicer for other data fields that I have. Year is the only date field that my data has. Is there a way to calculate Cost per Client for the previous year?

 

Thank you in advance!

  • Anonymous's avatar
    Anonymous
    5 years ago

    Thank you for the help!

     

    I was able to get it done by doing 

    CALCULATE([Cost per Client], REMOVEFILTERS(Table[year]),PREVIOUSYEAR(Table[date]))
     
    where the date variable was in the mm/dd/yyyy format.

2 Replies