Forum Discussion

learner03's avatar
learner03
Post Partisan
2 years ago
Solved

y-axis interval

How can I change y -axis interval from 0.5 to 0.25?

 

 

  • Hi learner03 
    Unfortunately no, this is my "pain" too :(.

    There is an idea about the issue you please vote for it:

    https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=8d290c47-1aba-4044-920c-ba0ae3981742

    This option is available in graphs with Deneb /charticulator graphs but you have to learn how to use them.

    More information is here :

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

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

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

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

     

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi learner03 ,

     

    I have a certain understanding of your problem.

    You want the y-axis interval of the column chart to be customizable. Unfortunately, this feature is not currently available in the cluster column chart of Power BI Desktop.

    But the solution we gave here is to use R script visual to draw a diagram yourself:

    Before you do this, you need to configure R script vasual and install R studio, information on how to use R script visual:

    Create Power BI visuals using R - Power BI | Microsoft Learn

    First of all, You can create a canvas by clicking R in the Visualizations bar on the right, and then drag your data into it.

    Then you can use the following code:

    --------------------------------------------------------------------------------

    library(ggplot2)

    ggplot(data=dataset,aes(x=column1,y=column2))+

    geom_bar(stat=”identity”)+

    scale_y_continuous(breaks=seq(0,25,by=5))+

    theme_classic()

    --------------------------------------------------------------------------------

    The purpose of

    ggplot(data=dataset,aes(x=column1,y=column))+ is to set the measure or column you want to visualize to the X and Y axes

    scale_y_continuous(breaks=seq(0,25,by=5))+, the meaning of this code is to set the interval of the y-axis to 0-25, and the interval is 5, You can change it according to your needs

    Enter the code and click this button to compile

    Here is the result:

    Best Regards,

    Zhengdong Xu

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

3 Replies

  • Hi learner03 
    Unfortunately no, this is my "pain" too :(.

    There is an idea about the issue you please vote for it:

    https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=8d290c47-1aba-4044-920c-ba0ae3981742

    This option is available in graphs with Deneb /charticulator graphs but you have to learn how to use them.

    More information is here :

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

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

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

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

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi learner03 ,

     

    I have a certain understanding of your problem.

    You want the y-axis interval of the column chart to be customizable. Unfortunately, this feature is not currently available in the cluster column chart of Power BI Desktop.

    But the solution we gave here is to use R script visual to draw a diagram yourself:

    Before you do this, you need to configure R script vasual and install R studio, information on how to use R script visual:

    Create Power BI visuals using R - Power BI | Microsoft Learn

    First of all, You can create a canvas by clicking R in the Visualizations bar on the right, and then drag your data into it.

    Then you can use the following code:

    --------------------------------------------------------------------------------

    library(ggplot2)

    ggplot(data=dataset,aes(x=column1,y=column2))+

    geom_bar(stat=”identity”)+

    scale_y_continuous(breaks=seq(0,25,by=5))+

    theme_classic()

    --------------------------------------------------------------------------------

    The purpose of

    ggplot(data=dataset,aes(x=column1,y=column))+ is to set the measure or column you want to visualize to the X and Y axes

    scale_y_continuous(breaks=seq(0,25,by=5))+, the meaning of this code is to set the interval of the y-axis to 0-25, and the interval is 5, You can change it according to your needs

    Enter the code and click this button to compile

    Here is the result:

    Best Regards,

    Zhengdong Xu

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      To implement R-Script type of visual, looks like we should have R installed in our local machine to install ggplot2 library.
      Else I see "package not installed" error.
      I don't mind setting up R in my PC but if I want to share my visual in my .pbi file to others, does that mean they also need to have R installed in their PC to view the visual?