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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vanessa
Post Patron
Post Patron

Max of Rank metric

I have created a metric to calculate the rank based on sales.

Now I want to do some further calculation for which I need Max of the Rank. 

 

I tried to create a simple metric to get the Max:

MaxRank=Max(RankMetric)

 

But Max can only be used with a column and not a metric.

 

Any solution for this?

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @vanessa,

 

As the max value of rank equals to the max row number of table visual, and it is dynamically changed according to slicer selection, it is not allowed to wrap a measure inside MAX function, you can directly count the row number. Similar to:

max Rank =
CALCULATE ( COUNT ( 'Sales Table'[Category] ), ALLSELECTED ( 'Sales Table' ) )

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @vanessa,

 

As the max value of rank equals to the max row number of table visual, and it is dynamically changed according to slicer selection, it is not allowed to wrap a measure inside MAX function, you can directly count the row number. Similar to:

max Rank =
CALCULATE ( COUNT ( 'Sales Table'[Category] ), ALLSELECTED ( 'Sales Table' ) )

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BeemsC
Resolver III
Resolver III

Just make a column for your ranking, and hide it?

@BeemsC

 

The rank is dynamic based on the selected filters:

I am ranking the product based on sales for the selected store and product category. Hence column won't help.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.