Forum Discussion

Marco57's avatar
Marco57
Helper III
5 years ago
Solved

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.

 

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not 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

    • Marco57's avatar
      Marco57
      Helper 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.

       

      • Anonymous's avatar
        Anonymous
        Not 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