A Power BI report uses a measure that calculates Year-over-Year sales growth. Users report that the measure shows incorrect values for January 2024 when compared to January 2023. The data model contains a Date table with a continuous date range from January 1, 2020 to December 31, 2024. Which DAX function is most likely causing the issue?
Trap 1: PARALLELPERIOD
PARALLELPERIOD shifts a set of dates forward or backward but requires a full period; it is less commonly used for simple YoY comparisons.
Trap 2: DATEADD
DATEADD is commonly used for YoY comparisons and can work correctly if the date range is continuous. It is not the most likely cause here.
Trap 3: PREVIOUSYEAR
PREVIOUSYEAR returns the whole previous year, which may cause incorrect comparisons when filtering by a specific month.
- A
PARALLELPERIOD
Why wrong: PARALLELPERIOD shifts a set of dates forward or backward but requires a full period; it is less commonly used for simple YoY comparisons.
- B
DATEADD
Why wrong: DATEADD is commonly used for YoY comparisons and can work correctly if the date range is continuous. It is not the most likely cause here.
- C
SAMEPERIODLASTYEAR
SAMEPERIODLASTYEAR is the most likely cause because it returns the same period from the previous year, but if the Date table lacks data for the entire previous period, it can produce incorrect results for month-over-month comparisons.
- D
PREVIOUSYEAR
Why wrong: PREVIOUSYEAR returns the whole previous year, which may cause incorrect comparisons when filtering by a specific month.