cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
skancharla
Advocate I
Advocate I

Dual Y axis in Line chart

Hi,

 

I'm working on a line chart and displaying 2 columns Project count and test count. Project count is in tens of number and test count in thousands.With a single Y axis ,the Project line almost looks flat.

 

Is there any option to have a second Y axis. I see that this option is there in Line and stacked column chart. 

But we want to have the columns projection as 2 lines and looking for it in Line chart. Please help.

 

Thanks.

18 REPLIES 18
Anonymous
Not applicable

Hi @skancharla ,


You can use a custom visual like below for dual Y-Axis in a line chart.

 

Dual Y axis in Line chart with PBIVizEdit.comDual Y axis in Line chart with PBIVizEdit.comDual Y axis in Line chart with PBIVizEdit.comDual Y axis in Line chart with PBIVizEdit.com

 

Download link on this page

https://pbivizedit.com/gallery/dual-y-axis-line-chart 

 

This was made with our Custom Visual creator tool PBIVizEdit.com. 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)

Give this a shot and let us know if you face any problems/errors.

You can use the editor to modify your visual further (some modifications cannot be done in Power BI window and have to be in the editor).

Thanks,

Team PBIVizEdit

Tommy75
Regular Visitor

I have an issue with the secondary Y-axis data labels.  I am trying to figure out a way to turn off the data labels on the secondary y axis line chart.  That option probably doesn't exist but having data labels on the secondary y axis makes my graph look super busy.

Guessing that you mean "having data labels on the series elements that relate to the secondary axis"?  the whole idea behind adding a secondary axis is to show the scale of those series elements that have a different scale from the primary.  You can of course selectively show labels on the various Series elements  (Line and clustered column chart--Data Labels--Customize Series).  Unlike Excel though, you can't format each data point.

 

Hope this helps!

rdawoud
Regular Visitor

Anonymous
Not applicable

I can't agree more. Power BI is meant for finding trends in data etc, how are you meant to find a trend if you can't compare 2 different types of data??

 

I spoke to Power BI and they said I could go to one of their partners and pay them to make a custom visualisation for me. If I am paying this much for Power BI, shouldn't I expect it would do something simple as this (look at how google charts does it, its simple as and you can add more than 2).

 

The way to implement this (especially more than 2) would be to have the name and values in the y axis for which ever line you hover over.

Not sure when it was added but the Line and Clustered Column Chart visual has the ability to define 2 Y axes. 

Seems to work as expected when I show all my data unfiltered.

When I apply certain filter values, the left Y axis disappears... Apparently, there are some values that don't compute somehow for the axis.  I did some troubleshooting and determined that the left y axis in my case is for the lines and 2 of the line series values rely on DAX Percentile function. I tried to capture any error condition on the dax formula so it now looks like:

P90Value = IFERROR(PERCENTILE.INC(tx_vEvents[eKpiNotifyAge],.9) , 0 )

But the Y axis still disappears under certain (but not all) filters.

Please advise Microsoft - thanks!
BeemerBum
Advocate I
Advocate I

I also throw my dis-affection regarding the lack of visual support for complex (or not so complex) data.  PowerBI needs to at the LEAST parallel Excel for graphs and visuals.  The expecation would be that PowerBI would exceed the Excel capabilties "out of the box"

I know this is old but anyone still looking, but this blog explains how to create dual y-axis chart, and has a link to the finished visual:

 

https://powerbi.tips/2019/09/dual-y-axis-line-chart/

 

Annotation 2019-10-23 151620.png

 

 

 

Appreciate your Kudos
Connect with me!

Stay up to date on  linkedin-logo.png
Read my blogs on  powerbi.tips_.png



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



Really helpful.. 

 

Thanks to your efforts. 

sits
Advocate I
Advocate I

Well done Power BI.  You're supposed to act as a SQL Server front-end, yet, Excel has more functionality for visualisation.  Why do you even exist?

Actually Option is there and I managed to find it after bit of playing ... yes it's not obvious.

Improtnant thing is you will not see the option as you have to scroll down to see it; after expanding the arrow Under Y-Axis (Column). Hope this helps.

Instruction here : https://powerbi.microsoft.com/en-us/documentation/powerbi-service-tutorial-combo-chart-merge-visuali...

 

 

That's not what people are trying to solve for. We need to be able to plot 1 measure on the primary axis and another on the secondary. 

Old thread but I've been looking for something similar for a while.    Turns out Zoomcharts Advanced Drilldown Column Chart already does this and probably has for a while... I'm disappointed I didn't realize it sooner because I bought it a while ago for grouped stacked columns, another not-available-out-of-the-box feature that I needed.   

 

Don't be fooled by the name, you can draw up to 12 series and they can all be lines (not columns).  Primary and Secondary Y Axes available. 

 

Hope this helps someone else. 

 

 

Hi Everyone,

 

I figured I would add to this since I found a creative solution/workaround that may or may not work for you.

 

Essentially, 2 line graphs, one in front of the other with one graph having the y axis values on the left and the other on the right. The graph in front, set the background to be fully transparent to be able to see the graph in the back. Position, size, and edit formats accordinaly. For me, the one in front has

  • no borders - since had to be sized a little smaller
  • no y axis grid lines - so it doesn't look too messy witht he grid lines from other graph and  being in front you'll see the line graphs instead of the gridline being over it
  • no x axis labels - same as x axis labels on other graph
  • I made the rear graph solid lined, and front graph dotted lined, and just called out the difference in the title

Not perfect, and may not work for all situations but should work for some!

 

If you stack two charts on top of each other like this, how do you get to the one at the back in order to select it and make changes?  Select the one in front and then Format, Send Backward?  It would be nice if there was a visual selector dropdown at least.

 

UPDATE:  Actually, on the VIEW tab there is a "Selection Pane" checkbox where you can select visuals.

tbfrancis
New Member

I sahre your frustration!  There is even a tutorial on how to do it, but the option is not present on my version.  I wonder if this will be in the next release?

 

https://powerbi.microsoft.com/en-us/documentation/powerbi-service-tutorial-combo-chart-merge-visuali...

 

 

Frustrated about this here too.  It's super simple in Excel but non-existent in Power BI.  Doesn't make any sense to me.

Greg_Deckler
Super User
Super User

Probably need to look at a custom visual or R visual.

 

http://robjhyndman.com/hyndsight/r-graph-with-two-y-axes/


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors