Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm trying to rank companies based on different metrics and in this specific case I want to use card visualizations to show ranking of each measure only for XPO Logistics. I've already looked up a few related topics here and on google but still cannot figure out what is wrong with my measure.
The problem arises when I filter by market. Without any box checked, the measure is working as intended but when I click, for example, on Memphis, XPO is ranked 10th while it's actually 9th. Any idea what can be changed to make it accurate?
I'm attaching the file for review
bump. Still struggling with this
Hi,
the file is deleted, and I could not find any file.
Hi,
I am not sure if I understood your question correctly, but please try the below measure.
Unsafe Driving Rank =
RANKX (
FILTER ( ALLSELECTED ( Data ), [Unsafe Driving Measure] <> 0 ),
[Unsafe Driving Measure],
,
ASC,
DENSE
)
In my opinion, if the order is ASC, then the companies that have zero value of Sum of unsafe driving get ranking number one. Selecting an option of Dense or Skip is based on the business requirement.
Jihwan,
0 means that the company has had 0 incidents of unsafe driving and should be ranked 1st so we should not be omitting the 0. The formula your provide seems to be doing the same thing as mine and doesn't rank correctly once we apply the market filter
Hi @Anonymous,
Did these '0' records real include in your tables? If they mean your table does not include these types of records, Dax formulas can't directly calculate with these not existed records.
For this scenario, you may need to add a parameter table with all companies to force expand and calculate on them.
Regards,
Xiaoxin Sheng
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 36 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |