Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Leeny127
Frequent Visitor

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 following error:

A column specified in the call to function 'PARALLELPERIOD' is not of type DATE. This is not supported.

This confuses me because the column specified is a Date type column (see screenshots below). Any guidance on why this is happening would be appreciated.

 

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

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

 

Current year error % is calculated with the measure [Error%]:

Error% =
DIVIDE(
 SUM('Count_Paralender_Merge'[# of Errors]),
 SUM('Count_Paralender_Merge'[# of Fields Possible]))

 

PBIVisual1.PNGPBIVisual2.PNG

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

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

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.