1

For a dashboard, I need to create an "interactive" plot of a shape. This shape is defined by a set of points X/Y but not always sorted on X (on purpose). However, it seems that Power BI is always performing the sort leading to the wrong shape. For example with those points:

X   Y
0   10
5   10
6   12
7   12
6.5 8
10  6
12  4
11  0

I was expecting :

expected

But instead I have with line chart:

result

I've looked into the line chart option without success and also in the marketplace. Is there a workaround ? I'd be surprised that power BI does not have the capability for such a small thing.

If there is no option, is there something else I could look at in order to have the plot with capability to zoom ? I saw that we cannot use plotly on power BI (https://community.powerbi.com/t5/Desktop/Use-Plotly-with-Python-Script-in-Power-BI/td-p/720797). Is that still actual in version January 2020 ?

Many thanks,

Nicolas

2
  • Create an index column, example here stackoverflow.com/questions/55363055/… then sort X by 'sort by another column' to preserve the data order Commented Apr 22, 2021 at 12:00
  • Thanks for your feedback. I was exactly thinking about that. I've added an index column but on the plot, I can't see any sort by another column. I have Power BI Desktop January 2020 Commented Apr 22, 2021 at 12:06

2 Answers 2

1

Using your example data, create an index column. You need to do it in Power Query, as it may result in a circular reference if you do it in DAX.

enter image description here

Make the axis sort by this new column, using the 'Sort by column' feature and selecting the new index.

enter image description here

Which should give you

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Awesome, thanks a lot :). I was on the right track but did not realized that the sorting is different for each column and has to be applied specifically on X.
-1

I have the same task, but my x values contain duplicates. It prevents these x values from sorting the way it is described above.

enter image description here

How possible is it to find a solution in this situation?

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.