DAX Function Guide
PARALLELPERIOD
Sam McKay
CEO & Founder
How does the PARALLELPERIOD work?
PARALLELPERIOD Formula Syntax
PARALLELPERIOD(
<dates>,<number_of_intervals>,<interval>
)
How do you use the PARALLELPERIOD?
This function takes the current set of dates in the column specified by dates, shifts the first date and the last date the specified number of intervals, and then returns all contiguous dates between the two shifted dates. If the interval is a partial range of month, quarter, or year then any partial months in the result are also filled out to complete the entire interval.
Related Blog Posts
Loading
Considerations when using the PARALLELPERIOD?
The dates argument can be any of the following:
- A reference to a date/time column,
- A table expression that returns a single column of date/time values,
- A Boolean expression that defines a single-column table of date/time values.
If the number specified for number_of_intervals is positive, the dates in dates are moved forward in time; if the number is negative, the dates in dates are shifted back in time.
The interval parameter is an enumeration, not a set of strings; therefore values should not be enclosed in quotation marks. Also, the values: year
, quarter
, month
, day
should be spelled in full when using them.
The result table includes only dates that exist in the dates column.
If the dates in the current context do not form a contiguous interval, the function returns an error.
Related Video Tutorials
Loading
Formula examples using the PARALLELPERIOD
=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), PARALLELPERIOD(DateTime[DateKey],-1,year))
=CALCULATE( COUNT(CRASH_DATA_T[CASENUMBER]), PARALLELPERIOD(Calc_Date_T[CRASH_DATE], -1,YEAR))
= CALCULATE(SUM(FactSales[Net_Sales]),PARALLELPERIOD(DimCalendar[Date_Id],-1,YEAR))
Related Courses
Loading