Forum Discussion

Leeny127's avatar
Leeny127
Frequent Visitor
8 years ago
Solved

Reason for error: 'A column specified in the call to function 'PARALLELPERIOD' is not of type DATE'?

Hello - I have created a calculated column to show Error % from the previous year, so that I can compare to the current year in a visual. I am using a PARALLELPERIOD formula but keep getting the foll...
  • v-juanli-msft's avatar
    8 years ago

    Hi Leeny127


    Calculated column [Previous Yr. Error%] has the formula:

    Previous Yr Error % = CALCULATE('Count_Paralender_Merge'[Error%],PARALLELPERIOD('Count_Paralender_Merge'[Created].[Month],-12,MONTH)) 


     

    Pay attention to the bold character, this parameter should be in date type.

    Please modify the formula with the following one

    Previous Yr Error % = CALCULATE('Count_Paralender_Merge'[Error%],PARALLELPERIOD('Count_Paralender_Merge'[Created],-12,MONTH))

    In DAX, PARALLELPERIOD always returns full periods at the given granularity level instead of the partial periods that DATEADD returns. So please check if the dates in date column are continuous. If the dates in the current context do not form a contiguous interval, the function returns an error.

    Reference:
    PARALLELPERIOD Function (DAX)

     

    Best Regards

    Maggie