Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I'm doing 2 measures, one that shows business ranking by the amount of money (RANK) which is displaying properly and my TOP rank that is suppose to show the number 1 from my RANK measure, in this case it should be "SUPERMERCADO SANTILLAN", but is showing "BOTICA CUIDAMOS" for some reason.
The table I'm using is "HIST_DOC"
Here is my RANK code:
RANK = RANKX(ALLSELECTED(HIST_DOC[NOM_EMP]), CALCULATE(SUM(HIST_DOC[MON_TOT])), , DESC)
Here is my TOP code:
TOP = CALCULATE(FIRSTNONBLANK(VALUES(HIST_DOC[NOM_EMP]),1) , FILTER(HIST_DOC, [RANK] = 1))
Here is a picture for a better understanding
Try this version
TOP =
var RNK = RANKX(ALLSELECTED(HIST_DOC[NOM_EMP]), CALCULATE(SUM(HIST_DOC[MON_TOT])), , DESC)
return CALCULATE(FIRSTNONBLANK(VALUES(HIST_DOC[NOM_EMP]),1) , FILTER(ALLSELECTED(HIST_DOC), RNK = 1))
It's still showing "BOTICA CUIDAMOS" but it's right next to the rank 1 row
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
6 | |
2 | |
2 | |
2 |
User | Count |
---|---|
5 | |
4 | |
4 | |
3 | |
3 |