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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
truiz-rico
Regular Visitor

Line chart (y axis; seconday y axis and legend issues)

 

Hi I need you help, because I am facing an issue trying to create my line chart.

 

I am trying to create a line chart with 

x axis (datetime column). --> A

y axis (average of a column). --> B

secondary y axis (an already measure created). --> C

 

Then I would like to include legend which only affects y axis (B). This legend is another column belongs to the same table

Then when I am trying to create my line chart and I complete A, B and C, pbix cannot allow me to include legend. Maybe its because should I change some of the A,B, and C?

 

 

 

When I try to create the line chart with no legend, the result is legitime, but it is impossible fullying legend field.

 

Please could you help me? 

1 ACCEPTED SOLUTION
v-jialongy-msft
Community Support
Community Support

Hi @truiz-rico 

When you have two or more fields on the Y-axis, you need to place your categorical column in the 'Small Multiples' field, as displaying them on a single chart would cause confusion.

vjialongymsft_0-1737095171669.pngvjialongymsft_1-1737095183800.png

 

 

 

 

Best Regards,

Jayleny

 

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

 

 

 

View solution in original post

5 REPLIES 5
v-jialongy-msft
Community Support
Community Support

Hi @truiz-rico 

When you have two or more fields on the Y-axis, you need to place your categorical column in the 'Small Multiples' field, as displaying them on a single chart would cause confusion.

vjialongymsft_0-1737095171669.pngvjialongymsft_1-1737095183800.png

 

 

 

 

Best Regards,

Jayleny

 

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

 

 

 

v-jialongy-msft
Community Support
Community Support

Hi @truiz-rico 

I'm not quite sure about your exact requirements. Do you want to display multiple categories of data on the Y-axis, like in the image below?

vjialongymsft_0-1737007701308.png

 


If so, you just need to add a column to categorize the data you put on the Y-axis and then place this column in the legend field.

If not, could you show what you have achieved so far and your expected result in the form of an image? You can also refer to the following documentation to learn how to create a line chart in Power BI.

 

Create line charts in Power BI - Power BI | Microsoft Learn

 

 

 

 

 

Best Regards,

Jayleny

 

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

Hi,

 

I have to make a line chart in which I place on the X axis the date of creation of certain transactions. On the y-axis I would like to include a measure already calculated and that works correctly in other charts, which measures an average ratio in %.
On the secondary y-axis I would like to insert a calculated column that works correctly in other charts, which measures average price in $.
So far everything works correctly.

The thing gets complicated when we try to introduce a column of the table as a legend, which indicates the market of each txs. I would like this to affect only the y-axis and not the secondary axis (average % ratio)

If we remove one of the y-axis, the legend works perfectly for each of the lines. However, as soon as we have 2 y-axes, it does not let me drag the legend column to the legend field.
One of the examples in the columns and measures could be:

 

X AXISLEGENDY SECONDARY - AXISY AXIS
creationmarketaverage price $average ratio %
June 2024Spain100$80%
danextian
Super User
Super User

Hi @truiz-rico 

 

As always, please provide a workable sample data (not an image). Your expected result from the same sample data and the reasoning behind. You may post link to a sanitized copy of your pbix or an Excel file stored in the cloud. https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi,

 

I have to make a line chart in which I place on the X axis the date of creation of certain transactions. On the y-axis I would like to include a measure already calculated and that works correctly in other charts, which measures an average ratio in %.
On the secondary y-axis I would like to insert a calculated column that works correctly in other charts, which measures average price in $.
So far everything works correctly.

The thing gets complicated when we try to introduce a column of the table as a legend, which indicates the market of each txs. I would like this to affect only the y-axis and not the secondary axis (average % ratio)

If we remove one of the y-axis, the legend works perfectly for each of the lines. However, as soon as we have 2 y-axes, it does not let me drag the legend column to the legend field.
One of the examples in the columns and measures could be:

 

X AXISLEGENDY SECONDARY - AXISY AXIS
creationmarketaverage price $average ratio %
June 2024Spain100$80%

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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