Forum Discussion
PBI5851
3 years agoHelper V
Capture average based on slicer
Hello folks, please can you help me figure out on how to capture the average days a member has acted based on the ActDate slicer. So when the slicer has the dates, i need to capture the latest row ...
- 3 years ago
Hi,
Please check the below picture and the attached pbix file.
Count members: = COUNTROWS( SUMMARIZE( Data, PerID[PerID]))Actdays: = VAR _lastdatecalendar = MAX ( 'Calendar'[Date] ) VAR _lastdateactdate = MAXX ( FILTER ( ALLSELECTED ( Data ), Data[PerID] = MAX ( PerID[PerID] ) && Data[ActDate] <= _lastdatecalendar ), Data[ActDate] ) RETURN IF ( HASONEVALUE ( PerID[PerID] ), CALCULATE ( SUM ( Data[Actdays] ), 'Calendar'[Date] = _lastdateactdate ) )Total actdays: = SUMX( VALUES( PerID[PerID]), [Actdays:] )Average actdays: = AVERAGEX( VALUES( PerID[PerID]), [Actdays:] ) - 3 years ago
Ashish_Mathur
3 years agoSuper User