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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Iamnvt
Continued Contributor
Continued Contributor

Shift Date by a number of days

hi,

 

this has a simple problem; however, my mind is wandering around and couldn't find a solution for that.

I have a measure A = sum(Values) by date

 

and I want to calculate measure B = Measure A shifted 3 days earlier.

 

tried: calculate(A, filter(Date table, Date = Date -3)), but it doesn't work.

any helps pls?

Thanks

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

try this

 

calculate(A, filter(Date table, Date = lastdate(Date) -3))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Iamnvt,

 

To shift either forward or backward in time by the specified number of intervals from the dates, you may take a look at DATEADD Function.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MattAllington
Community Champion
Community Champion

try this

 

calculate(A, filter(Date table, Date = lastdate(Date) -3))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors