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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
platinum
Regular Visitor

Dateadd formula month to date previous period problem

Hi,

I have some probles with measures for for previous period. I created matrix in wich I look at current year from Jan 1st and every day updating data for yesterday (full day). There is first split  by week then by date in matrix rows.

For curent year it's calculated as it should, but when I calculate for example for period 4 years ago it returns wrong Total at the end of matrix.

Subtotals on a week level are fine, but if you see on the bottom there is total up to 31.01.2019 not to 16.01.2019 because I need to have the same period of 4 years ago.  But if I choose from date slicer for example 15th instead of 16th (yesterday actualy) it works fine. I need somehow to limit measure to use period 4 years ago until yesterday date.

As you see subtotals for weeks in the Total should return 10.553K (01.01.2019-16.01.2019) but it returns 17.979K (01.01.2019-31.01.2019) and that is for whole january of 2019.

platinum_1-1674021687247.png

I used following measures:

Sales current year = SUM(DailySales[Sales_CY])
Sales CY - 4 Dateadd = CALCULATE([Sales current year], DATEADD(DATES[Date], -4, YEAR))
I even try with Parallelperiod but it returns whole year, and it is great for some other ideas 🙂
Sales CY - 4 Parallel period = CALCULATE([Sales current year], PARALLELPERIOD(DATES[Date], -4,YEAR))
 
I have separate DATES lookup table, in which there are split by weeks (Year & Week), and other splits. 
 
I ran through many topics and searching through web but I couldn't find solution. Really tried to do it on myself but without any success.
Any help will be appreciate greatly.
 
Thanks.
Sasha
 

 

 

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.