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.
Hello,
Here's what my data looks like in the data pane:
As you can see, it's sorted by ringNumber (how it sorts rows with a equal ringNumber doesn't matter).
However, when I publish this to the web, the data is in a seemingly random order (as I'm developing a custom visual, specifically it's dataViews[0].table.rows that is unsorted, although I think this isn't particularly relevant to the question).
I've checked and the order given is not even that of the data in the Query editor, and I can't actually seem to spot any kind of order in the data. Is it just random? How can I preserve order when publishing to web?
Thank you.
Hi @callum,
I've checked and the order given is not even that of the data in the Query editor, and I can't actually seem to spot any kind of order in the data. Is it just random? How can I preserve order when publishing to web?
Have you tried using Table.Sort function(M) to sort your table by ringNumber column in Query Editor? Based on my understand and test, it should work in your scenario.
= Table.Sort(#"PreviousStepName",{{"ringNumber", Order.Ascending}})
Regards
Thanks for the idea, unfortunately ring number is a calculated column in DAX so M is not a solution!
Hi @callum,
What's the logic of creating the ring number column? I'm just wondering if you could create a custom/conditional column for ring number within Query Editor using M instead, then the solution could work?
Regards
Hi,
Basically, my visual looks like this:
(Basically a Power BI version of Thoughtworks' Tech Radar)
So each "point" on the visual is a row in the dataset, and has a "ring" column which is either "Accelerate", "Progress", "Monitor" or "Pause". I'd like to be able to specify the order the rings are plotted in, i.e. Accelerate is the inner circle, Pause is the outer ring, etc.
At the moment I'm hardcoding these values into my visual's code, but obviously this is a very inflexible solution as it doesn't allow any modifications!
I've just tried your M method - it does work in Power BI desktop, but on uploading to the web, the data provided to the visual still seems to be in a random order.
Perhaps this is more of a visual development issue rather than an M/DAX/PBI Desktop issue then? I'll see if there's any ideas in the Development forum.
I would think you would order it when you retrieve it into your custom visual. Generally, the order of the data is not important and you do your sorting within the visualization. Why does the order of the raw data matter?
Because in my visual I wish to enable the user to have a say in how it gets rendered, e.g. the rows that are first in the dataset get rendered first. Is there no way of achieving this then?
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 |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |