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
WKBILearner
Frequent Visitor

Need help with doing a Cummulative to a Moving Measure

Hi - is there a way to create a Cummulative dax measure for the following already calculated Moving 8 weeks Sales Measure : 

 

Moving 8wk Sales =

CALCULATE(sum(SalesLines[Quantity]),DATESINPERIOD(Dates[Date],MAX(Dates[Date]),-56,DAY))

 

The result I wanted to achieve is in the  column D below : 

 

WKBILearner_0-1686379955765.png

 

6 REPLIES 6
Mahesh0016
Super User
Super User

@WKBILearner I hope this helps you! THANK YOU!!

Cummulative 8wk Sales =
CALCULATE([Moving 8wk Sales],Dates[Month]<=MAX(Dates[Month])

Hello there - thanks for the reply. Unfortunately it gives the same results as my original "Moving 8 wks" calculation : 

Cummulative 8wk Sales =
CALCULATE([Moving 8wk Sales],Dates[Date]<=MAX(Dates[Date]))
Moving 8wk Sales =
CALCULATE(sum(SalesLines[Quantity]),DATESINPERIOD(Dates[Date],MAX(Dates[Date]),-56,DAY))
 
WKBILearner_0-1686387819724.png

 

Hii @WKBILearner you have used Date[date] column in filter but look in my measure i have used Date[Month] column , Please Try that and share your views.THANK YOU!!

Hello again - I used Date[Month] - but it looks the same : 

 

WKBILearner_0-1686403685705.png

 

The Date[Month] column I have is as per below : 

 

WKBILearner_1-1686403770959.png

 

@WKBILearner I hope this helps you!THANK YOU!!

Cummlative_sum =
CALCULATE ( [TotalSales], FILTER(ALLSELECTED('Date'),'Date'[Month] <= MAX ( 'Date'[Month] ) )
)

Mahesh0016_0-1686576701288.png

 

Hi again,

 

Thanks again for the help - but this time it has no result.  It looks like a Cummulative may not be possible to add onto a Measure that has a "DatesIn Period" in there..

 

Moving 8wk Sales =
CALCULATE(sum(SalesLines[Quantity]),DATESINPERIOD(Dates[Date],MAX(Dates[Date]),-56,DAY))
Cummulative 8wk Sales2 =
CALCULATE([Moving 8wk Sales],FILTER(ALLSELECTED(Dates),Dates[Month]<=MAX(Dates[Month])))
 
WKBILearner_0-1686581330305.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