Forum Discussion
Anonymous
3 years agoNot applicable
Calculate weighed average
I want to make a measure that calculate a weighted average of how many minutes our customers have been actively shopping in our store but I can´t for the life of me figure out how to do this in DAX. ...
- 3 years ago
Try
Avg Minutes = VAR CustomerMinutes = SUMX ( 'Table', ( 'Table'[Minutes in store] - 'Table'[Minutes In Queue] ) * 'Table'[Customers] ) VAR Customers = SUM ( 'Table'[Customers] ) RETURN DIVIDE ( CustomerMinutes, Customers )
johnt75
3 years agoSuper User
Try
Avg Minutes =
VAR CustomerMinutes =
SUMX (
'Table',
( 'Table'[Minutes in store] - 'Table'[Minutes In Queue] ) * 'Table'[Customers]
)
VAR Customers =
SUM ( 'Table'[Customers] )
RETURN
DIVIDE ( CustomerMinutes, Customers )