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
Anonymous
Not applicable

Current Week Sales based on Filter Date

Kindly assist, how can I change the dax measures below;

I want that when I select a filter date range e.g. 2023-01-08 to 2023-01-14 it must show me the total sales for the week based on the filter date selected and it must also show me for example previous week sales e.g. 2023-01-01 to 2023-01-07, the current measures below only show the current week and the previous week based on the current date it does not allow me to apply the dates based on the filter date selected.

 

Current Week Sales =
CALCULATE ( [TOTAL Sales], DimDate[Week Offset] = 0 )

 

Prior Week =

CALCULATE ( [TOTAL Sales], DimDate[Week Offset] = -1 )

3 REPLIES 3
Mahesh0016
Super User
Super User

@Anonymous 

Mahesh0016_1-1681539944248.png

 

Total Sale = SUM(Sales_Table[Sales])
Previous Week Sale = CALCULATE([Total Sale],DATEADD(Sales_Table[Date],-7,DAY))
Week Over Week = [Total Sale]-[Previous Week Sale]

@Anonymous  Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
 
Mahesh0016
Super User
Super User

@Anonymous can you share excepted out and sample data.

thank you!

 

Anonymous
Not applicable

The Sample data and the expected results, your assistance would be highly appreciated.

Sample Data and expected Results.png

 

 

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.

Top Solution Authors