cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
luisvieira95 Frequent Visitor
Frequent Visitor

Show the average of top n values in a measure

I am trying to get the average of the top 100 performing students in a cicle of tests to put in a line chart with "Materia" on the shared axis to compare with a specific studant, filtering by "Ciclo" and "PeriodoLetivo",.
I have created a table to calculate the avg performance of every student that had done the specific cicle selected, and in that table i want to create the measure in topic. Here's an example of my table

CodigoSimuladoNumeroPerguntaAcertosSimuladoTipoSimuladoCicloPeriodoLetivoIDQuestãoMateriaFrenteArea de Conhecimento
515131Ciclo 5 2016 Banca PoliedroSimulado FUVESTCiclo 5201651513GeografiaGeo 2CH
515460Ciclo 5 2016 Banca PoliedroSimulado FUVESTCiclo 5201651546MatemáticaMat 1MT
515580Ciclo 5 2016 Banca PoliedroSimulado FUVESTCiclo 5201651558FísicaFís 1CN

 

Thats the formula that i tried to do without any success

Média Acertos Ciclo TOP 100 = 
var media1 = AVERAGEX('MÉDIA CICLO';'MÉDIA CICLO'[Acertos])
return
CALCULATE(TOPN(100;'MÉDIA CICLO';media1;DESC);'MATERIA FRENTE'[Frente])

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Show the average of top n values in a measure

HI @luisvieira95,

 

You can try to use following measure if it suitable for your requirement:

measure =
AVERAGEX (
    TOPN (
        100,
        SUMMARIZE (
            Table,
            [Ciclo],
            [PeriodoLetivo],
            "Total Acerto", SUM ( 'Table'[Acertos] )
        ),
        [Total Acerto], DESC
    ),
    [Total Acerto]
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
luisvieira95 Frequent Visitor
Frequent Visitor

Re: Show the average of top n values in a measure

Hi!
Thank you, but it calculates the same exact value of the avg of the whole cicle, and not the Top 100.

Highlighted
Community Support Team
Community Support Team

Re: Show the average of top n values in a measure

Hi @luisvieira95,

 

You can remove topn function and direct do averagex on summarize table.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |