cancel
Showing results for
Did you mean:
Highlighted
Responsive Resident

## 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

Accepted Solutions
Highlighted

## Re: Shift Date by a number of days

try this

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

* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
2 REPLIES 2
Highlighted

## Re: Shift Date by a number of days

try this

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

* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Highlighted
Community Support

## Re: Shift Date by a number of days

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.

Announcements

#### August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

#### Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

#### Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

#### Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors