Forum Discussion
adriano321souza
7 years agoFrequent Visitor
calculate the average
Good Morning! I have the following problem: I want to calculate the average of the values shown on the screen from the TOPN filter, that is, when selecting one of the TOPN items to print the aver...
- 7 years ago
Is this problem sloved?
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
Best Regards
Maggie
v-juanli-msft
Community Support
7 years agoPlease check my pbix,
create measures as below
value = SUM(dRelAtend[Valor]) rank = RANKX(ALL(dRelAtend[Cliente]),[value],,DESC,Dense) selected = SELECTEDVALUE(TopNTable[TopNValues]) count = CALCULATE(DISTINCTCOUNT(dRelAtend[Cliente]),FILTER(ALL(dRelAtend[Cliente]),[rank]<=[selected])) sum = SUMX(FILTER(ALL(dRelAtend[Cliente]),[rank]<=[selected]),[value]) average = [sum]/[count]
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.