Showing results for 
Search instead for 
Did you mean: 
Luukv93 Frequent Visitor
Frequent Visitor

Need your help with a measure



I'm trying to understand of the following measure: (30 Day Running Total).

1. I would say there are 2 row contexts: Total sales has row context because of the previously used formula SUMX, and FILTER generates a row context.


2. How does the FILTER, ALL and MAX logic work?


Your help is much appreciated





30 Day Running Total = 
CALCULATE( [Total Sales];
	FILTER( ALL( Dates );
		Dates[Date] > MAX( Dates[Date] ) - 30 &&
		Dates[Date] <= MAX( Dates[Date] ) ) )

Total Sales was calculated with measure:


Total Sales = SUMX( Sales; Sales[Quantity] * RELATED( Products[Current Price] ) )




v-yulgu-msft Super Contributor
Super Contributor

Re: Need your help with a measure

Hi @Luukv93,


Here are some blogs for your reference:

Filter context in DAX

ALL DAX function


Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 266 members 2,210 guests
Please welcome our newest community members: