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
JohnP
Regular Visitor

Scatter Chart: dynamic X and Y axis title

Hello ... I just started learning Power BI and it seems really good so far!

 

I have a scatter chart as shown below. The axis titles are automatically named from the columns dropped in the Axis X and Axis Y (AxisX and AxisY in this case). However, I have a requirement that the axis should be named after another column in the same table (see also pic below). The content of the name columns could change depending on the dataset/report/filter. So, is it possible to name the axis titles after the name columns in this case? Or are there some other tricks in queries etc?

 

scatter.jpg

table.jpg

8 REPLIES 8
Anonymous
Not applicable

You can do this by layering a shape on top of the visual. Either turn off the visual axis titles or if you need to preserve the padding you can leave it on but insert a rectangle over the axis title without a border or outline and a solid infill.

 

A shape allows you to specify the rotation of text. You can then make that vertical as needed and the text can be a formula. Typically I would use this with a trend that has multiple series on it. The axis changes based on the single filtered series. When using text formula it uses first/last/count so if necessary, you may need to create a calculated string column that has the display you need based on current filters.

dropdown filtering y axis title 1.pngdropdown filtering y axis title 2.png

stretcharm
Memorable Member
Memorable Member

 

@cwebb has a post that shows you how to do dynamic titles

https://blog.crossjoin.co.uk/2016/04/25/dynamic-chart-titles-in-power-bi/

 

So you could do the X and a horizontal Y text. You cannot rotate the test though.

 

You could also try using Bookmarks and Selection visability if there are only a few options and select one with an image toggle.

https://docs.microsoft.com/en-us/power-bi/desktop-bookmarks

https://www.youtube.com/watch?v=_Afcj8mT5_Q

https://databear.com/power-bi-bookmarks/

 

Final option would be to use r which has lots of flexibility with charts

https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals

 

You can rotate the text now !

 

I got what you are looking for, Firstly your power bi desktop should have September'18 update.
Secondly, you must import "Text Enhancer by MAQ Software" visualization from marketplace.
Once, you are through with the second step, place your dynamic measure under field category, then go to its text settings and change it's direction to vertical !
Vola !

Thanks for your input @stretcharm ...  it's hard to understand why the axis title is hardcoded to the name of value column. The only option available is to override it in a textbox in the format tab.

 

This really seems like a simple feature to implement by entering a formula instead of a just text in the format tab. Many other BI solutions have this as a basic feature. Not only dynamic titles - also about min/max values of the axis, color etc.

 

The R charts are not really an option since you cannot interact with them like native visualizations. Also in the simple test I did I couldn't get them to respond to slicer choices (the native ones did). The other options are just "hacks", IMO, and is not worth the time and effort (especially since there is no rotate text).

JohnP
Regular Visitor

I posted an idea that I think would be very useful ... not only for my challenge, but for many others:

 

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/32532082-customize-format-visuali...

Hi,

It's very simple. Please import "Text Enhancer by MAQ Software" visualization from marketplace.
Once, you are through with the second step, place your dynamic measure under field category, then go to its text settings and change it's direction to vertical !

If it helps, like the post. 🙂

Yes, this is a good solution. However, it is effectively layering another visual on top of your chart. This solution will not work if you have (for example) small multiples enabled. Because you'd need the y-axis title to scroll with the multiples.

cool. I've voted for it.

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.