Forum Discussion
Average difference between two MIN dates (Summarizing Measures with Averages)
- 8 years ago
Hi SebL
From your description, you are wanting to calculate the average of the expression in [Measure 4] over Users in the current filter context. You can use AVERAGEX to do this.
Something like this should do the trick (I'm guessing the table containing the User ID column table is called Users):
Measure 4 Average over Users = AVERAGEX ( VALUES ( Users[User ID] ), IF ( ISBLANK ( [Measure 1] ), [Measure 2] - [Measure 3], [Measure 1] - [Measure 3] ) )Or this should work as well:
Measure 4 Average over Users v2 = AVERAGEX ( Users, IF ( ISBLANK ( [Measure 1] ), [Measure 2] - [Measure 3], [Measure 1] - [Measure 3] ) )Regards,
Owen
Thanks, this worked perfectly.
I'm wondering if I could add a follow-up question.
I now have the average number of days per user being displayed over time. How would I go about creating a measure that displays the percentage of those users that are under a certain threshold of days?
That's good news :)
I'm assuming you still have [Measure 4] which can be evaluated per User.
To calculate % users under a certain threshold, you can do something like this:
Users under threshold % =
VAR UsersUnderThreshold =
COUNTROWS ( FILTER ( VALUES ( Users[User ID] ), [Measure 4] < Threshold ) )
VAR TotalUsers =
DISTINCTCOUNT ( Users[User ID] )
RETURN
DIVIDE ( UsersUnderThreshold, TotalUsers )Does that work for you?
- SebL8 years agoFrequent Visitor
That worked perfectly.
Thanks for the help!