The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance 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 |
---|---|
26 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |