Forum Discussion
How to create a segment with N first line from a table report order bye amount value ?
- 2 years ago
Lefuneste57 - Just to clarify, my solution will work for you & it is dynamic (because it uses a measure), so the ranking will be re-calculated according to any filters you use on the page.
But you will need to use the measure below in any visual that you want to see this behaviour. There is no need to use a page filter because the measure handles the visual filtering. So if you want to filter an entire page, place the measure in every visual.
It works by only displaying the amount value when the rank number is lower than or equal to the number in the slicer. The slicer is created using these instructions: https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-what-if
VAR Number_to_Rank = [Number of Lines (by order amount) Value] // from the numeric range parameter VAR _amount = [_amount] // sum( amount ) RETURN IF ( RANKX ( ALLSELECTED ( 'Table (6)'[Item], 'Table (6)'[Build] ), [_amount] ) <= Number_to_Rank, _amount ) // Returns the amount for any items that with a rank within the numbers specified in the Numeric range parameter.
Thank for your reply.
I hope you will find a solution for my problem.
Créate a column is fine but the the problem is that in my report, I have filters on this visual. And when I filter, I lose sorting by amount.
thanks again for trying to help me
Lefuneste57 - this would not be an issue in my solution becase the ranking would be dynamic.
The ranking that uses a column is static and therefore does not pay attention to filters.
- Lefuneste572 years ago
Helper I
Thank you for answer,
It's still a shame that it is not possible to do this type of filter on a page knowing that the filter pane allows it (advanced "N first" filtering).