Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
25 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
27 | |
13 | |
13 | |
11 | |
6 |