cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Iamnvt Member
Member

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
Super User
Super User

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.

View solution in original post

2 REPLIES 2
Super User
Super User

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.

View solution in original post

Highlighted
Community Support Team
Community Support Team

Re: Shift Date by a number of days

@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.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 233 members 2,161 guests
Please welcome our newest community members: