Forum Discussion

JohnP's avatar
JohnP
Icon for Advocate II rankAdvocate II
8 years ago

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?

 

8 Replies

  • stretcharm's avatar
    stretcharm
    Icon for Memorable Member rankMemorable 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

     

    • JohnP's avatar
      JohnP
      Icon for Advocate II rankAdvocate II

      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).

    • saurabhgora's avatar
      saurabhgora
      Regular Visitor

      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 !

  • Anonymous's avatar
    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.