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
djwitkowski
Helper I
Helper I

Dual Y-axis Trouble

Hello,

 

I have a line and clustered column chart with the following variables:

  • # of shipments per day
  • Avg shipment cost ($)
  • Avg expected cost
  • Avg Daily Loads (a horizontal line representing avg daily # of loads for selected time period)

 

The value for Avg daily loads below is 467, but you can see that the position is based on the $ scale on the right, rather than the # of loads axis on the left. It doesn't help to have it so much lower than the blue bars, because the goal is to see how each day varies from the avg.

 

Is it possible to get the Avg daily loads to use the left y-axis?

 

djwitkowski_0-1647976646596.png

 

Thanks in advance,

Dan

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

Hi @djwitkowski ,

 

The custom visual Multiple Axes Chart - XViz can realize your needs. But it is only free for Desktop, if you want to use it on Service, you need to buy it.

 

Then use the Multiple Axes Chart to set the axis range of one of the line charts to be the same as the axis range of the bar.

vkkfmsft_3-1648175915622.png            vkkfmsft_1-1648175862583.png        vkkfmsft_2-1648175882766.pngvkkfmsft_0-1648175813815.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

7 REPLIES 7
v-kkf-msft
Community Support
Community Support

Hi @djwitkowski ,

 

The custom visual Multiple Axes Chart - XViz can realize your needs. But it is only free for Desktop, if you want to use it on Service, you need to buy it.

 

Then use the Multiple Axes Chart to set the axis range of one of the line charts to be the same as the axis range of the bar.

vkkfmsft_3-1648175915622.png            vkkfmsft_1-1648175862583.png        vkkfmsft_2-1648175882766.pngvkkfmsft_0-1648175813815.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi,

 

It is a bit hard to see if your question is answered or not. Even if the issue is marked as answered, there are some lines of text among the replies implying that it still isn't.

 

However, there is a solution that I think may solve your problem.

 

By the screenshots provided it seems like you could benefit from upgrading your Power BI Desktop to the latest version. It is now possible in most of the standard chart visualisations in Power BI Desktop to have a measure setting the max value for the primary and secondary Y axis.

 

Here is an example:

Make a measure according to this pattern:

MyYAxisMax = IF(MeasureA > MeasureB, MeasureA, MeasureB)

 

MeasureA and MeasureB represents the two measures that you want to "compete" in setting the max value. In my case it was a "competing" situation, in your case it may not be so much of a competition, but nevertheless, it should work.

 

Add the measure MyYAxisMax to the primary Y axis max value and secondary Y axis respective max value by clicking the fx-button (which is present in later versions of Power BI Desktop) next to it and then selecting the measure in the list.

 

Good luck, please let me know if it works.

 

 

@Mrtnkbg thank you for your reply. I did mark the response about the custom visual as a solution, but never left a comment to clarify. I will update my pBI to the latest version, but I'm not sure your suggestion would give me what I'm looking for.

 

I'm not so concerned with the max y-axis value, as I was trying to find a way to assign specific variables to the non-default y-axis. It puts all bars on one y-axis, and all lines to the other y-axis, and I needed one of the line variables to be assigned to the y-axis that the bars were assigned to. The custom visual recommended by Community Support above would work, but I won't be using it since it requires payment to publish. I ended up just putting the constant avg line as a card next to the chart.

truptis
Community Champion
Community Champion

@djwitkowski , why don't you use avg daily loads in your values so that they come in the bars instead of a line and you can compare?

@truptis I could do this if no one else can suggest a solution, but it would make the chart a lot less clean and straightforward to view.

djwitkowski
Helper I
Helper I

@truptis Thank you for the response, but this does not solve my issue. I need the # of loads and the avg daily loads variables to be on the same scale, so they can be compared visually. Since the avg daily loads variable is a line, it is using the $ scale, but this makes it difficult to compare to the bars, which are using a different scale. I need to know if it is possible to get the avg daily loads aligned with the other axis, even though it is a line and not a bar.

truptis
Community Champion
Community Champion

Hi @djwitkowski ,

Select your visual and go to format pane and turn off the secondary axis. By this way, you won't see values on your right hand side.

 

Please hit the thumbs up & mark it as a solution if it helps you. Thank you.

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.