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 am making a simple product category ranking by product category.
When I use rankx function without slicer, ranking is as follows:
When I apply slicer filter f.e. on Packaged Chocalate, the ranking changes from 9 to 10:
Some rank positions after applying filter remain the same, some not.
The ranking function looks as follows:
Solved! Go to Solution.
Nothing but (inevitable) floating-point inaccuracy ever since the creation of modern computer (binary notation)
The solution is very straightforward,
Total Sales =
INT(
SUMX(
'Sales by Store',
'Sales by Store'[quantity_sold] * 'Sales by Store'[unit_price]
)
)
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Nothing but (inevitable) floating-point inaccuracy ever since the creation of modern computer (binary notation)
The solution is very straightforward,
Total Sales =
INT(
SUMX(
'Sales by Store',
'Sales by Store'[quantity_sold] * 'Sales by Store'[unit_price]
)
)
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Hi @gumis_rulez
Have you tried changing ALL to ALLSELECTED?
Rank Test =
IF(
HASONEVALUE( 'Product Lookup (Updated)'[product_category] ),
RANKX(
ALLSELECTED( 'Product Lookup (Updated)'[product_category] ),
[Total Sales]
),
BLANK()
)
Let me know if you have any questions.
When using ALLSELECTED if you select only one category, this category will have rank 1.
The goal is when you have selected packaged chocolate the rank should be calculated based on total sales of all categories and have 9 in this example.
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 |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |