Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Help: Using PREVIOUSYEAR() returns a Blank column...

I am using the following to calculate a goal measure:   goal = calculate(count(FactInternetSales[CustomerKey]),PREVIOUSYEAR(FactInternetSales[OrderDate]))*1.05     But get a blank column. How ...
  • v-yingjl's avatar
    6 years ago

    Hi Anonymous ,

    To use previous year function, you can create a continuous date table by this measure:

     

    Table = CALENDARAUTO()

     

    Then modify your measure like this:

     

    goal = calculate(count(FactInternetSales[CustomerKey]),PREVIOUSYEAR('Table'[Date]))*1.05

     

    You will get the following result:

     

    Here is the demo , please try it:

    PBIX 

     

    Best Regards,

    Yingjie Li

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.