Reply
pfinanciero
Frequent Visitor

Average in total row Rankx

Hi its me again 🙂 

 

I did the following formula to rank some data with two (2) filters:

RANKX(
FILTER(Prueba,Prueba[Fecha] = EARLIER(Prueba[Fecha])
&& Prueba[Indicador] = EARLIER(Prueba[Indicador])),
Prueba[Valor],,DESC,Dense
 
I need to calculate the average in the total row of RANKX, it is posible? Let me know if you need more information or data.
Thanks!
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @pfinanciero ,

 

Try to create 2 measures:

Measure_ranking = AVERAGEX(VALUES('Table'[Indicador]),AVERAGE('Table'[rank]))
Measure_valor = AVERAGEX(VALUES('Table'[Indicador]),AVERAGE('Table'[Valor]))

Vlianlmsft_0-1641535662830.png

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @pfinanciero ,

 

Try to create 2 measures:

Measure_ranking = AVERAGEX(VALUES('Table'[Indicador]),AVERAGE('Table'[rank]))
Measure_valor = AVERAGEX(VALUES('Table'[Indicador]),AVERAGE('Table'[Valor]))

Vlianlmsft_0-1641535662830.png

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

smpa01
Super User
Super User

@pfinanciero  provide sample data and expected output

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Hi @smpa01 ,

I have the following data chart:

1.PNG

In the firt column "Razón social" are the names of the diferents companies, the secod column shows the type of the rate or indicator (if its an asset or a sale) for this example, the third column are the values and the last one is the year.

with this information I build the following table: 

2.PNG

As you can see I insert an slicer with "Razón social" because the idea of the chart is to shows the values and raking of each company selected.

I need to calculate in the total row of the column Ranking the average of the results of that year, for example:

Fecha2018 2019 2020 Total 
IndicadorValor RankingValor RankingValor RankingValor Ranking
Activos133.80271131.80190145.18581410.78881
Ventas136.12469124.006101124.68294384.99288
TotalBLANK70BLANK96BLANK88BLANK85

The basic pattern for this will look like:

AVERAGEX (
    SUMMARIZE ( Prueba, Prueba[Fecha], Prueba[Indicador] ),
    [Ranking measure]
)

Note that if there is only one Fecha and Indicador in the filter context, you're only averaging over one value, so the result is the same as [Ranking measure].

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)