Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have an issue I couldn't solve because I have negative values in my data, and the DAX below cannot rank it. For example, when ranking the ROS KPI and choosing the top 5, it shows only 4. I don't know why. Here is a sample of my data:
Year | Customer Name | ROS
2022 | Client A | -0.38%
2022 | Client B | 8.05%
2022 | Client C | 0.89%
2022 | Client D | 14.53%
2022 | Client E | -3.55%
2022 | Client F | -0.69%
Top Avg ROS by Rank =
VAR RankingDimension = VALUES('Credit Benchmarking'[Customer Name])
VAR RankingSelect = [Ranking Select]
RETURN CALCULATE( [Avg ROS], FILTER( RankingDimension, RANKX(ALL('Credit Benchmarking'[Customer Name]), [Avg ROS], , DESC,Dense) <= RankingSelect ))
Can you help me resolve this issue?
Solved! Go to Solution.
Well received.
However, the ranking slicer is not affecting the visual as expected. The client has multiple ROS values spanning two or three years, and I also have a slicer for the year.
When I apply your solution, it displays all the clients regardless of selecting the top 3, 5, or 10. Additionally, when I choose a specific year, the output disappears.
@Romani ok, so modify your calculated column as:
I want to create a report where users can use slicers to select between different categories, industries, or sub-industries. Based on their selection, the report should display the top achievers for the chosen category, industry, or sub-industry, for a specific year or across two years. And in the above Pic these are the KPIs
@Romani you have to add all the categories in the rank measure, if you want the top three/five/ten for each of them, as i did for the year, so:
ROS Rank_year_industry =
VAR CurrentYear = 'Credit Benchmarking'[Year]
VAR CurrentIndustry = 'Credit Benchmarking'[Industry]
RETURN
RANKX(
FILTER(
ALL('Credit Benchmarking'),
'Credit Benchmarking'[Year] = CurrentYear &&
'Credit Benchmarking'[Industry] = CurrentIndustry
),
'Credit Benchmarking'[ROS.3],
,
DESC,
Dense
)
In this case i added the condition for "Industry".
Please accept the first answer as solution, these are evolutions of the request.
BBF
it is very good till now
but i have very little issue i want to view the top 3 or 5 or 10
even no year is selected or i select more than one year together
@Romani You can try with this new flag measure:
To ensure the correct implementation of ranking measures and flags for "Return on Sales (ROS)" in Power BI, I should follow these steps:
Create the column for overall ROS ranking:
Create the column for ROS ranking based on year, industry, category, and sub-industry:
Create the measure to flag the top rankings based on the selected criteria:
Despite following these steps, I am not getting the desired output. Specifically, when choosing the rank without considering the year, it does not reflect correctly.
@RomaniI probably understood, the first formula must be like this:
ROS Rank = VAR CurrentIndustry = 'Credit Benchmarking'[Industry GB Lease Classification] VAR CurrentCategory = 'Credit Benchmarking'[Category] VAR CurrentSubIndustry = 'Credit Benchmarking'[Sub-Industry (level 4)] RETURN RANKX( FILTER( ALL('Credit Benchmarking'), 'Credit Benchmarking'[Industry GB Lease Classification] = CurrentIndustry && 'Credit Benchmarking'[Category] = CurrentCategory && 'Credit Benchmarking'[Sub-Industry (level 4)] = CurrentSubIndustry ), 'Credit Benchmarking'[Return on Sales (ROS)], , DESC, DENSE )
Try.
BBF
no it doesnt work
what i want when iam chosing the rank without year to reflect on the visuals
and when iam chosing the industry and rank it reflect too on the visuals
i dont want my ranking to be reflect if iam chosing one filter or iam choosing more than one
@Romani Can you explain with some examples? on the last pbix i 've sent to you, so that we can restart from that point.
BBF
I didnt get any answer from your side
@Romani i wrote you if you can explain the problem with some examples on the last pbix i 've sent to you, so that we can restart from that point.
BBF
Please check your email
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 |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |