Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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].

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.