OpenBI Docs Buy

PARALLELPERIOD

The whole months, quarters or years the filter context touches, moved by a number of them.

Group: Time intelligence. Compatible with DAX.

Syntax

PARALLELPERIOD ( <dates>, <number_of_intervals>, <interval> )
ParameterTypeDescription
datesDatesA column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model.
number_of_intervalsWhole numberHow many periods to move: forward when positive, back when negative.
intervalKeywordMONTH, QUARTER or YEAR. DAY is an error.

Returns

Table. Every date of the whole periods the filter context touches, moved by the number of periods.

Remarks

  • Unlike DATEADD, it does not keep to the dates selected: one day of March, moved back a year by YEAR, gives the whole of the year before.
  • A selection that spans two months gives both whole months moved, with everything between.
  • Only dates the column holds come back: a date the move or the period lands on that the column lacks is left out, and when none is left the table is empty.
  • Given a column, it reads the dates visible in the current filter context; in a row context, such as ADDCOLUMNS, the row becomes a filter first, so each row sees its own dates.

Examples

The same month against the whole year before

March 2025: DATEADD takes March 2024, PARALLELPERIOD all of 2024.

EVALUATE
CALCULATETABLE (
    ROW (
        "Liters", [Liters sold],
        "Same month a year before", CALCULATE ( [Liters sold], DATEADD ( Sales[Month], -1, YEAR ) ),
        "The whole year before", CALCULATE ( [Liters sold], PARALLELPERIOD ( Sales[Month], -1, YEAR ) )
    ),
    Sales[Month] = DATE ( 2025, 3, 1 )
)
LitersSame month a year beforeThe whole year before
4359343893586171

Whole quarters

From March 2025, the next quarter is April to June.

EVALUATE
CALCULATETABLE (
    PARALLELPERIOD ( Sales[Month], 1, QUARTER ),
    Sales[Month] = DATE ( 2025, 3, 1 )
)
ORDER BY Sales[Month]
Sales[Month]
2025-04-01
2025-05-01
2025-06-01

DATEADD, SAMEPERIODLASTYEAR, PREVIOUSYEAR, NEXTQUARTER.

Last updated · OpenBI Studio 0.3.74