cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Newcolator
Helper I
Helper I

Line chart with 2 series on different axes and legend

Hello

 

I have two series I want to put on a line graph, but they have different scales so one of the series needs to be on the secondary y-axis. But my data also has a legend value that I want to use. I can do this in Excel with a pivot chart, see example below. But I can't seem to do this in Power BI; it won't let me put a value on both y-axes and add a legend, it just doesn't accept the columns when I drag them in. I'm using Version: 2.106.883.0 64-bit (June 2022). Is this feauture not available? Is this possible? I guess I could try pivoting the data in Power BI like I did in Excel, but then I'd have to label my columns with the year, which will need updating every new year, not ideal.

 

Newcolator_0-1674642040866.png

 

1 ACCEPTED SOLUTION
MAwwad
Super User
Super User

In Power BI, you can indeed have a series on the primary y-axis and another on the secondary y-axis and also use a legend.

However, in order to do this, you will need to create a new table with the data that you want to use for the line graph. This table should have columns for the x-axis values, the primary y-axis values, the secondary y-axis values, and the legend values. Once you have this table, you can then create a line chart and drag the columns for the x-axis, primary y-axis, and secondary y-axis into the corresponding fields in the visualizations pane.

Then, you can add the legend value by going to the Format pane, select the Data label and Select the column you want to use as legend.

View solution in original post

1 REPLY 1
MAwwad
Super User
Super User

In Power BI, you can indeed have a series on the primary y-axis and another on the secondary y-axis and also use a legend.

However, in order to do this, you will need to create a new table with the data that you want to use for the line graph. This table should have columns for the x-axis values, the primary y-axis values, the secondary y-axis values, and the legend values. Once you have this table, you can then create a line chart and drag the columns for the x-axis, primary y-axis, and secondary y-axis into the corresponding fields in the visualizations pane.

Then, you can add the legend value by going to the Format pane, select the Data label and Select the column you want to use as legend.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors