Forum Discussion
Using rankx and calculate
I'm pretty sure you just have to turn it around and use a switch statement like
%Top 30 = Switch (true(), ranking<=30, calculate(sum(sales))
You might not need the true( ) expression but, that is a place to start and it would allow you room to calculate the others as well I think.
Hi, thank you for answering. Power BI allowed me to calculate the measure but it showed the total amount of sales.
Facturación = sum('BBDD UTMS'[Total Neto Faena USD]) ; total amount= $ 25.335.100
- TCarrasquillo6 years agoHelper II
I'm not totally sure, It seems like it's just not pulling out the ranked as it's supposed to. I would try using ALLSELECTED instead of ALL in your ranking measure.
- Anonymous6 years agoNot applicable
Changing to allselected didn't work :( Thank you for answering, though :)
- TCarrasquillo6 years agoHelper II
I'm looking at this again, I think the rank formula is not quite right.
Try replacing the Calculate portion with your measure for the sum of sales.
I hope that works for you.