cancel
Showing results for
Did you mean:
Highlighted
Frequent 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 average on a card.
Thankful!

Exemple

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: calculate the average

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

4 REPLIES 4
Community Support Team

## Re: calculate the average

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.

Frequent Visitor

## Re: calculate the average

in the top 10 is it possible to show only the values ​​of the first 10 lines?

Community Support Team

## Re: calculate the average

It is possible, based on my pbix,

create a measure

`Measure = IF([rank]<=[selected],1,0)`

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.

Community Support Team

## Re: calculate the average

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

Announcements

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!