Forum Discussion
Modify the legend order
- 10 years ago
You have to create Measures for each type of Status
Then place each Measure in the Values area in the order you wish
I responded to a similar question but for a pie chart today - it works exactly the same way with a bar chart
http://community.powerbi.com/t5/Desktop/Rearrange-Pies-in-Pie-Chart/m-p/25218#U25218
You have to create Measures for each type of Status
Then place each Measure in the Values area in the order you wish
I responded to a similar question but for a pie chart today - it works exactly the same way with a bar chart
http://community.powerbi.com/t5/Desktop/Rearrange-Pies-in-Pie-Chart/m-p/25218#U25218
- dapster1058 years agoAdvocate III
I would like to offer other web visitors what I think is an even better invisble solution in some circumstances, which is to prefix your text with a number of unicode 'zero width space' characters (https://www.fileformat.info/info/unicode/char/200B/index.htm).
Each of these characters has a code, and PowerBI will honour it in its default sorting, but the characters are not visible. Therefore you can add as many as you like. The more you add, the earlier the string will sort.
In my case, I do this in the SQL view definition which is the source of data for PowerBI e.g.
SELECT CASE [somenvarcharfield] WHEN 'alpha' THEN NCHAR(8203)+'alpha' WHEN 'beta' THEN......
e.g. producing the following strings in SQL...
NCHAR(8203)+N'alpha'
NCHAR(8203)+NCHAR(8203)+N'beta'
NCHAR(8203)+NCHAR(8203)+NCHAR(8203)+N'gamma'
Will produce the visible sort order in PowerBI...
gamma
beta
alpha
It may be possible to inject these unicode characters straight into the PowerBI user interface but I haven't tested this - the above works well for me and I generally stick to doing as much work in the view (rather than in PowerBI) as possible.
I hope this helps someone else.
Tim
- Coriel-114 years agoResolver II
For a less scary variation of what dapster105 suggested what you can do is:
1- Use the "Create groups" function to create a new group for each entry you want in your table.2 - Hit the windows key and type "Character Map" and open Windows' inbuilt Character map window (you can't do any harm with this!).
3 - In the "Go to Unicode" box type "200C" (without the quotes). Click "Select" & "Copy".
4 - Go back into the groups you created and for each group, paste this character at the start of the group name. Then add a number of spaces, depending on where you want it to appear in the list (the more times you paste it, the higher it ranks)*
5 - Replace the original field with this group in at least one place on the visualisation.
6 - Make sure that you chose this field as the one to sort by, reversing the sort order if needed.
This is as much so I can find it in future as anything, but hope it will help others. It really shouldn't require this...
Matt
*So in the box for the group name the 1st character should be the U200C one, followed by a mnumber of space, followed by the actual title you want to appear.
- Anonymous2 years agoNot applicable
Hi there, this seems like the perfect solution but unfortunately PowerBI doesn't seem to recognize the inserten U220C characters for me. Do you have an idea if the software changed at some point or does it still work for you?
- mmena6 years agoRegular Visitor
Can someone provide an example of this Measure?
- Anonymous6 years agoNot applicable
Hi,
U can place only one measure in values area ,if you create 10 measures for each status how will you put this 10 measures in value ?
Please suggest
Thanks