Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a line chart, it is ordred properly but when I hover my mouse over to each data point, those values are not in the order I want. how do I change that? Example screenshot is shown below:
In Above screenshot I hovered over to June and I got All legents but I want to order this legend by Value not Legend lable. How do I do that?
Solved! Go to Solution.
Hi @Anonymous,
In both examples, the fields are unchanged and look like this:
Note that the Tooltips field is empty.
The difference between examples is that in the second one, I created a column called Country Sort that I used to sort the Country column by, as shown in the article I linked in my above post (specifically this section), e.g.:
This is because the visual itself does not allow (or think it needs to allow) sorting, so you can force the Legend value to sort by using the sort by column approach.
You will need to determine how this sort value is generated, based on your data. Note that values for each value of the field that goes into Legend will need to be unique for your sort column. Here's a partial table of how these fields look side-by-side so you can see how you might want this to work in your report:
This is also a design pattern you would want to use to create ordinal attributes that shouldn't sort alphabetically, e.g. month name.
Good luck!
Daniel
If my post helps, then please consider accepting as a solution to help other forum members find the answer more quickly 🙂
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @Anonymous,
The order is dictated by the field you're using in the Legend box - you'll notice that the values are sorted alphabetically.
If you want to change this, you'll need to assign a sort by column to the field you're using.
Here's an example with some data I have - countries are sorted alphabetically:
Now, I've applied a custom order to my countries - note that they appear differently:
You should be able to see the differences between both examples, including the legend sort order.
Hopefully this should be all you need to get moving. Good luck!
Daniel
If my post helps, then please consider accepting as a solution to help other forum members find the answer more quickly 🙂
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
I see. Thank You very much for your time. is it possible for your to show a screenshot of your Visualization fields on the right? I was thinking it is something to do with tooltips.
Hi @Anonymous,
In both examples, the fields are unchanged and look like this:
Note that the Tooltips field is empty.
The difference between examples is that in the second one, I created a column called Country Sort that I used to sort the Country column by, as shown in the article I linked in my above post (specifically this section), e.g.:
This is because the visual itself does not allow (or think it needs to allow) sorting, so you can force the Legend value to sort by using the sort by column approach.
You will need to determine how this sort value is generated, based on your data. Note that values for each value of the field that goes into Legend will need to be unique for your sort column. Here's a partial table of how these fields look side-by-side so you can see how you might want this to work in your report:
This is also a design pattern you would want to use to create ordinal attributes that shouldn't sort alphabetically, e.g. month name.
Good luck!
Daniel
If my post helps, then please consider accepting as a solution to help other forum members find the answer more quickly 🙂
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
This may work in a normalized table but my table have data that gets aggregated in the line graph. Sorting column seems tobe difficult. For example my data looks like this:
Docs | Date | XCount | YCount |
A | 11/20/2019 | 0 | 1 |
B | 11/20/2019 | 5 | 1 |
C | 11/20/2019 | 1 | 0 |
A | 12/21/2019 | 0 | 1 |
B | 12/22/2019 | 3 | 2 |
D | 12/22/2019 | 1 | 0 |
A | 12/23/2019 | 4 | 2 |
I have Mutiple document codes for every day and counts for each day. Now my chart shows these counts by Month- means it aggregates counts to month level by each document code. How do I sort document by Ycount now- that is the agregated count in chart but no aggregated in table?
Thanks
Hi @Anonymous,
If you can't reproduce the measure result as a calculated column then the sort by column approach will not work for you, as you have discovered. This is now a little beyond my knowledge, and it might be better to ask the DAX forum if they have any suggestions for you - that forum has a lot more traffic and people who may be able to suggest an alternative much faster than the Developer forum.
Regards,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
I see okay. Thank you for your help. I think your solution is definitely going to work for other situations.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |