Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
l_ke
Frequent Visitor

Wrong scale in dual axis line chart?

Hi all, I want to create a dual axis line chart, Y1 axis shows the actual figure(price), Y2 axis shows the index (rebased number of price). Supposed these two lines should be totally overlapped, but in fact they are not. 

 

What I want (produced by python):

whatiwant.JPG

 

Howerver in Power BI line chart:

linechart.JPG

 

I have already set the Start and End properties in Y-axis and Secondary Y-axis as Auto, but it's not working. Is it a bug or something else that I miss? For now I'm using Python visual but it cannot be viewed on web after publish, so I cannot use Python visual as the replacement.

 

I'm happy for any comments.

9 REPLIES 9
asitm
Helper III
Helper III

@l_ke 

you can do this using a custom visual. below image shows the final result using custom visual. the two visuals overlap exactly. this is using your sample data.


dual line exact overlap.png

This custom visual was created with our tool PBI VizEditor.
With this tool,

  •  anyone, irrespective of technical skills, can create their own visuals
  • 15 minutes to create a visual from scratch
  • opens up many additional attributes to edit (for e.g. labels, tooltips, legends position, etc)

We are in beta testing currently, and hope to get the first general release by October 2021.
Give this a shot and let us know if you face any problem/errors.


For your convenience, I have created a custom visual that allows you to have the visual you requested and you can download it from below link
https://pbivizedit.com/gallery/dual_axis_line_overlap

 

You can use the editor to modify your visual further (some modifications cannot be done in Power BI window and have to be in editor). We have tried to keep it intuitive and user friendly, but for the first time user, some handholding might be needed.

If you need tutorial/guidance to use the editor (we are still limited on help files), I can help with that.


thanks,

AsitM

v-xulin-mstf
Community Support
Community Support

Hi @l_ke,

 

After publishing to the power bi service from the desktop, there may be some security and enforcement restrictions that will cause python visual to be disabled.

You can refer:https://powerbi.microsoft.com/de-de/blog/python-visualizations-in-power-bi-service/

 

For publishing to web, cunrrently it is not supported python.

v-xulin-mstf_1-1622180645036.png

Please refer:https://docs.microsoft.com/en-us/power-bi/collaborate-share/service-publish-to-web#limitations

 

Best Regards,
Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Yes, I understand, so currently python visual cannot be the workaround.. That's why I'm wondering if anyone know how to deal with this "situation" (lines are not totally overlapped) :')

Hi @l_ke,

 

Could you provide your sample data or pbix after removing sensitive information?

I test with my sample data and it works well in my environment.

 

Best Regards,
Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Hi, please find the pbix here , thank you

Hi @l_ke,

 

Is there a specific algorithm for converting between index columns and price?
Maybe you can create a measure to convert price to index.

 

Best Regards,
Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Hi @v-xulin-mstf ,

 

Sorry for late reply as I have been busy during these days. The index is calculated by something like

price/first_value(price) over partition ([col] order by date) * 100 

 

Can it be done in power bi? I tried but failed.

 

Thanks for your time.

RJ251997
Helper I
Helper I

Hi @l_ke ,

You can follow this link for dual axis its help you 

https://exceleratorbi.com.au/dual-axis-line-chart-in-power-bi/

Thank & Regards

Rohit Jaiswal

l_ke
Frequent Visitor

Hi, thanks for your suggestion, unfortunately the lines are also not totally overlapped in this custom visual :')

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.