Forum Discussion
Line chart X,Y sorted
Hello,
I am astonished by the lack of capability for a vizualisation and table tool like power bi.
I want to create that chart as in Excel but with power bi chart line Y vs X.
I am expecting:
I am getting:
This is my data:
As you can see, I can't sort X by Index as power bi is complaining:
Which makes absolutely no sense at all. Why on eart would you not be able to sort 'X' by 'index' simply because 'X' has identical values for different values of 'index'. 'index' values are different and that's the key, I am asking to sort by a column which is having different values, where is the issue of doing this? If 'index' was containing duplicates, I would understand it is not able to sort 'X' according it but ut is exactly not the case here ...
I tried two things here which did not work without even being able to understand why:
- Creating a power query step to sort the data by increasing index. This should order X as well. The line chart visual is completely ignoring this upfront sorting by Power Query. Very strange why thus it would take it into account the sorting when the column is sorted according another one and not sorting from Power Query? There is absolutely not an ounce of sense here
- Creating a concatenated column of index and x column:
This would allow me sorting column Merged column according Index which indeed happens without error.
But for sure this does not work and the line chart really needs the 'X' column to be sorted and not another one.
To be honnest I can't beleive in 2021 for a world classe tabular tool with vizualisations specilization we are not able to do such primitive manipulation.
I hope I am missing an obvious workaround that someone would know about.
Many thanks in advance for any support.
Rgds
Marc.
Hi Marco57 ,
The current visualization don't allow you to do this however you can use the charticulator visualization to create this:
https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa200002793?tab=overview
https://powerbi.microsoft.com/en-us/blog/announcing-the-new-charticulator-visual-public-preview/
This needs some tweeking but overall result is has you need, if you want assistance please tell me.
Check the PBI file attach.
4 Replies
- AnonymousNot applicable
Hi Marco57 ,
Sorry that I can't a good solution to achieve it. Here is a workaround: add Index field also in X axis as shown in below screenshot
Best Regards
- Marco57Helper III
Hello Anonymous
Thanks for your feedback but as you can see it does not result in the correct behaviour.
I think this should be a bug.
Rgds
Marc.
- AnonymousNot applicable
Hi Marco57 ,
The X values didn't display sort by ascending if add index in X axis fields... I'm sorry I couldn't find a suitable way to fulfill your needs.
Best Regards