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.
How to find the sum and average of the 5 lowest numbers in a table and store it in a measure?
Also, how to find the sum and the average of the top 5 numbers in a table and store it in a measure?
Solved! Go to Solution.
@Anonymous - All 3 measures involve a 2-step process.
Bottom 5 Average:
Bottom 5 Average =
var _bottom5 = TOPN(5, 'YourTable', [YourColumn], ASC)
return AVERAGEX(_bottom5, [YourColumn])
Top 5 Average:
Top 5 Average =
var _top5 = TOPN(5, 'YourTable', [YourColumn], DESC)
return AVERAGEX(_top5, [YourColumn])
Top 5 Sum:
Top 5 Average =
var _top5 = TOPN(5, 'YourTable', [YourColumn], DESC)
return SUMX(_top5, [YourColumn])
Hi ameyabhave,
You could try to refer to above suggestions, if this is not what you want , please correct me and inform me more detailed informations(such as your sample data and your expected output), then I will hrlp you more correctly.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous - All 3 measures involve a 2-step process.
Bottom 5 Average:
Bottom 5 Average =
var _bottom5 = TOPN(5, 'YourTable', [YourColumn], ASC)
return AVERAGEX(_bottom5, [YourColumn])
Top 5 Average:
Top 5 Average =
var _top5 = TOPN(5, 'YourTable', [YourColumn], DESC)
return AVERAGEX(_top5, [YourColumn])
Top 5 Sum:
Top 5 Average =
var _top5 = TOPN(5, 'YourTable', [YourColumn], DESC)
return SUMX(_top5, [YourColumn])
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 |
---|---|
106 | |
94 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |