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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
anhngv
Helper III
Helper III

Get data series from lastweek, lastmonth reading date point

I have a data set which everyday (rundate) I collect bookings (bkd) of future flights (flt_date). AP is number of days flight date pior to rundate (AP = Flt_date - Rundate). A data sample is attached as below:

 

 

I would like to compare booking data today (or whatever day I filter) with what is collected in a week ago (-7 days from today) or a month ago by AP.

 

I can compare with last day (of whatever rundate I filter) by previosday syntax

anhngv_1-1613709973057.png

 

Manythanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@anhngv , with help from date table example

Weekbehind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-7,DAY))

Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@anhngv , with help from date table example

Weekbehind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-7,DAY))

Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

solved, thanks and sorry I'm newbie 😄

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.