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
kadapavel
Helper II
Helper II

Rate of Change of Moving Average

Hi,

I have a measure which calculates moving average and now I'd like to calculate growth in % of the moving average. 

Is there a way to calculate such a thing?

Already tried with minx and maxx, it calculates min and max of each day and my moving average is for 30 days 

BR

Pavel

3 REPLIES 3
Stachu
Community Champion
Community Champion

can you share sample anonymised data and the syntax for the measure you're using?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Hi Stachu,

Table is like this

Pbi1.PNG

 

Measure syntax is

PMR-MA = if(ISBLANK(max('KPI Indices'[Rolling INdex])),BLANK(),

	VAR __LAST_DATE = LASTDATE('KPI Indices'[ResultDate])
	RETURN
		AVERAGEX(
			DATESBETWEEN(
				'KPI Indices'[ResultDate],
				DATEADD(__LAST_DATE, -30, DAY),
				__LAST_DATE
			),
			CALCULATE(SUM('KPI Indices'[ResultValue]))
		))

Result is

Pbi2.PNG

Stachu
Community Champion
Community Champion

do you mwan something like this?

Measure = 
VAR PrevDay = MAX('KPI Indices'[ResultDate])-1
RETURN
[PMR-MA]-CALCULATE([PMR-MA],'KPI Indices'[ResultDate]=PrevDay)

if you need %change then yo ucan use DIVIDE



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

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.