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.
I have a table called action items and I am trying to get the average of response values for only the first instance of a users response only if the response type is 99 AND only if there is a response value. Here is the table and I will show the desired output
UserID | ResponseID | Response Value | StatusofResponse | DateUpdated |
1 | 99 | 6 | 1 | 3/1/2020 |
2 | 99 | 9 | 1 | 3/3/2020 |
3 | 45 | 1000 | 1 | 3/3/2020 |
4 | 99 | 0 | 3/3/2020 | |
1 | 99 | 3 | 1 | 3/10/2020 |
2 | 45 | 4000 | 1 | 3/10/2020 |
2 | 99 | 3 | 1 | 3/12/2020 |
Desired output:
a measure whose result would be 7.5 (in this case, it was the average of UserIds 1 and 2 responses 6 and 9 respectively) -- userID 3 did not have responseID99 and userID4 had not responded (hence status value of 0). Further, I only wanted the first instance. any help would be greatly appreciated!!
Solved! Go to Solution.
See if this works, create the following column:
FirstDate = MINX(FILTER('Table',[UserID] = EARLIER([UserID]),[DateUpdated]
Now you can create a Measure like so:
Measure = AVERAGEX(FILTER('Table',[DateUpdated] = [FirstDate] && [Response ID] = 99 && NOT(ISBLANK([Response Value])),[Response Value])
Great!
See if this works, create the following column:
FirstDate = MINX(FILTER('Table',[UserID] = EARLIER([UserID]),[DateUpdated]
Now you can create a Measure like so:
Measure = AVERAGEX(FILTER('Table',[DateUpdated] = [FirstDate] && [Response ID] = 99 && NOT(ISBLANK([Response Value])),[Response Value])
I got it when I changed this Measure = AVERAGEX(FILTER('Table',[DateUpdated] = [FirstDate] && [Response ID] = 99 && NOT(ISBLANK([Response Value])),[Response Value])
to
Measure = AVERAGEX(FILTER('Table', [FirstDate] && [Response ID] = 99 && NOT(ISBLANK([Response Value])),[Response Value])
Great!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |