Forum Discussion
Syndicate_Admin
3 years agoAdministrator
Sorting columns in a graph
Good morning I have a chart with x number of columns but one of them I want to always appear first, as if it were independent of the order of the rest of the columns. Let me explain: A...
barritown
3 years agoSolution Sage
Hi,
If it is okay to perform sorting using an auxiliary slicer, I can propose such a solution.
1. We create an additional table with the options "asc" and "desc". It will be used in a slicer.
2. We create a measure like this:
Parameter for sorting =
VAR factor = IF ( SELECTEDVALUE('order'[order]) = "desc", 1, -1 )
VAR res = IF ( SELECTEDVALUE ( data[Parameter] ) = "E",
factor * SUM ( data[Value] ) + 1000,
factor * SUM ( data[Value] ) )
RETURN res
3. We add this measure to the Tooltips section of our bar chart - thus, it will appear in the "Sort axis" list.
4. Then we choose this measure in the sorting options and choose "Sort descending."
Here is the result for both options:
Should you need any clarifications, please let me know.