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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Timeperiod from today

Hello all,
can someone help me how to create a dynamic sum by Measuere? This should always be the sum of the last 7 days of our sales are drawn? The same for the last 4 weeks and the last half year, starting point should always be the current day.

 

Regards

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

@Anonymous 

The starting date can be

 

VAR LastDayWithSales = MAX ( Sales[Order Date] )

then you return the sales amount adjusting the filter context. For example 

RETURN

CALCULATE (

    SUM ( Sales[Sale Amount] ),

    'Date'[Date] >= LastDayWithSales - 49

)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

@Anonymous 

The starting date can be

 

VAR LastDayWithSales = MAX ( Sales[Order Date] )

then you return the sales amount adjusting the filter context. For example 

RETURN

CALCULATE (

    SUM ( Sales[Sale Amount] ),

    'Date'[Date] >= LastDayWithSales - 49

)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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