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
Anonymous
Not applicable

show top value of a measure as a card

Hello community! 🖐

I hope there is someone out there who can help me with this issue. 

I am building a dashboard where companies are scored by several criteria. this score is a measure and not a column in my data table. I want a card that shows the number 1 performing company, based on the highest score. there was an answer to a similar question with the solution:

Calculate(rankx(ALL('Table'[Supplier]),[Total Sales Volume]))

the problem with this formula is that it uses 2 columns, but I have the column (company) and a measure (PAM score). this formula does not work for me. next I tried this formula, and made a card out of it:

top performer = CALCULATE(RANKX(ALL(PAM2[company]), PAM2[PAM Score]))
this formula did work, but it gave the wrong result: it says "1 top performer". this is of course meaningless, I want the name of the top performing company. I already know that there is only 1 top performer, duh.. 
 
the interesting thing is that, when I use Q&A to simply ask "which company has the highest PAM Score?" it gives me the right answer. But when I make a card out of it, its:
1- ugly because its a mini table with 1 column, instead of just the name of the company,
2- not usable since I have sliders that adapt the score, and the card does not return the highest performing company when the scores change, but it changes the card value to the whole list of company names.
 
I hope I have provided you with sufficient information, and that there is someone out there who knows how to solve this issue. I appreciate your feedback! thanks in advance 😁
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I have built a data sample:

Eyelyn9_0-1638414049715.png

So based on your desciption, you want to display Company B in Card visual ,right?

Please try:

Top1 Company = 
var _t=ADDCOLUMNS(VALUES(PAM2[Company]),"Rank",CALCULATE(RANKX(ALL(PAM2[company]), PAM2[PAM Score])))

return CALCULATE(MAX('PAM2'[Company]) ,FILTER(_t,[Rank]=1))

Eyelyn9_1-1638414111273.png

 

 

Best Regards,
Eyelyn Qin
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
Anonymous
Not applicable

Hi @Anonymous ,

 

I have built a data sample:

Eyelyn9_0-1638414049715.png

So based on your desciption, you want to display Company B in Card visual ,right?

Please try:

Top1 Company = 
var _t=ADDCOLUMNS(VALUES(PAM2[Company]),"Rank",CALCULATE(RANKX(ALL(PAM2[company]), PAM2[PAM Score])))

return CALCULATE(MAX('PAM2'[Company]) ,FILTER(_t,[Rank]=1))

Eyelyn9_1-1638414111273.png

 

 

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

VahidDM
Super User
Super User

Hi @Anonymous 

If I got your point correctly, try this:

top performer = 
Var _A = filter(ADDCOLUMNS(PAM2,"Rank",RANKX(ALL(PAM2[company]), PAM2[PAM Score])),[Rank]=1)
return
MAXX(_A,[company])

 

it it does not work:

Can you post sample data as text and expected output?
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Anonymous
Not applicable

hello,

 

many thanks for your reply,

it did however not return the right solution, the other explanation did work fortunatly. 

thanks anyways for your time and effort 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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