Forum Discussion
SebL
8 years agoFrequent Visitor
Average difference between two MIN dates (Summarizing Measures with Averages)
Hi Guys, First post. I'm trying to create a measure that calculates the average difference between dates. To make things more complicated, these dates fields come from tables that contain mul...
- 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
OwenAuger
8 years agoSuper User
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?
SebL
8 years agoFrequent Visitor
That worked perfectly.
Thanks for the help!