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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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