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
Chanleakna123
Post Prodigy
Post Prodigy

Rolling Average + Label KPI NUmber in Average on MAP

1.PNG

 

Hi , i used to post this thread and now any problem settled yet on the Rolling Average of Each Description KPI. 

 

My purpose is to get the "Rolling Average of Each KPI" , then i know From Jan-Aug , what is the Average of this KPI. 

I used the Matrix as per above visualization and would like to see each KPI Rolling Average. 

****And , there's a map there. Is it possible that i can use the Label of The Average when i click on each KPI then the Map will appear the KPI number there . 

Can Anyone assist me on this case ? 

Thanks you so much . 

3 REPLIES 3
Greg_Deckler
Super User
Super User

Tough to say. Have you looked at the Rolling Average quick measure as a starting place? It goes like this:

 

Id rolling average = 
IF(
	ISFILTERED('vProofMessage'[MessageSentTimeLocal]),
	ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
	VAR __LAST_DATE = ENDOFMONTH('vProofMessage'[MessageSentTimeLocal].[Date])
	VAR __DATE_PERIOD =
		DATESBETWEEN(
			'vProofMessage'[MessageSentTimeLocal].[Date],
			STARTOFMONTH(DATEADD(__LAST_DATE, -3, MONTH)),
			ENDOFMONTH(DATEADD(__LAST_DATE, 3, MONTH))
		)
	RETURN
		AVERAGEX(
			CALCULATETABLE(
				SUMMARIZE(
					VALUES('vProofMessage'),
					'vProofMessage'[MessageSentTimeLocal].[Year],
					'vProofMessage'[MessageSentTimeLocal].[QuarterNo],
					'vProofMessage'[MessageSentTimeLocal].[Quarter],
					'vProofMessage'[MessageSentTimeLocal].[MonthNo],
					'vProofMessage'[MessageSentTimeLocal].[Month]
				),
				__DATE_PERIOD
			),
			CALCULATE(
				COUNTA('vProofMessage'[Id]),
				ALL('vProofMessage'[MessageSentTimeLocal].[Day])
			)
		)
)

Otherwise, going to need sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

1.PNG2.PNG3.PNG

 

hi @Greg_Deckler

 

can you help me to understand why it shown 1.00 for this rolling average ? 

i used such below calculation as you provided. 

 

Id rolling average =
IF(
ISFILTERED('Date'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
VAR __LAST_DATE = ENDOFMONTH('Date'[Date].[Date])
VAR __DATE_PERIOD =
DATESBETWEEN(
'Date'[Date].[Date],
STARTOFMONTH(DATEADD(__LAST_DATE, -3, MONTH)),
ENDOFMONTH(DATEADD(__LAST_DATE, 3, MONTH))
)
RETURN
AVERAGEX(
CALCULATETABLE(
SUMMARIZE(
VALUES('Date'),
'Date'[Date].[Year],
'Date'[Date].[QuarterNo],
'Date'[Date].[Quarter],
'Date'[Date].[MonthNo],
'Date'[Date].[Month]
),
__DATE_PERIOD
),
CALCULATE(
COUNTA(Metrics[Data Input]),
ALL('Date'[Date].[Day])
)
)
)

 

 

Can you help me to success this ? 

I have Date and Metrics Table which both are in relationship. 

 

Can i use Month to calculate this ? or just only date hirachy ? If only Month is it possible ? 

 

thx you 

2.PNG1.PNG3.PNG4.PNG

 

hI @Greg_Deckler , 

 

Thanks for your fast response. 

Here is the calculation i used : 

Id rolling average =
IF(
ISFILTERED('Date'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
VAR __LAST_DATE = ENDOFMONTH('Date'[Date].[Date])
VAR __DATE_PERIOD =
DATESBETWEEN(
'Date'[Date].[Date],
STARTOFMONTH(DATEADD(__LAST_DATE, -3, MONTH)),
ENDOFMONTH(DATEADD(__LAST_DATE, 3, MONTH))
)
RETURN
AVERAGEX(
CALCULATETABLE(
SUMMARIZE(
VALUES('Date'),
'Date'[Date].[Year],
'Date'[Date].[QuarterNo],
'Date'[Date].[Quarter],
'Date'[Date].[MonthNo],
'Date'[Date].[Month]
),
__DATE_PERIOD
),
CALCULATE(
COUNTA(Metrics[Data Input]),
ALL('Date'[Date].[Day])
)
)
)

 

 

but look like it turn all in 1.00 , and this only filter in a group of date hirachy ? so what about the date , which i just wanna put month there ? maybe i did sth wrong here ? 
Can you guide me to success this calculation ? 

I have Date Table , And Metrics which both are in relationship. 

 

thanks for your time. 

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.