The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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]))
Solved! Go to Solution.
Hi @Anonymous ,
I have built a data sample:
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))
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.
Hi @Anonymous ,
I have built a data sample:
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))
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.
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/
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 🙂
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |