Forum Discussion

BA123456's avatar
BA123456
Frequent Visitor
10 months ago
Solved

Scale error in bar chart

Hey,   can someone help me fix the scale of the bar chart (s. below). Depending on the categories I´m selecting, the scale of the bar chart is off.   First example Second example with each...
  • samratpbi's avatar
    10 months ago

    Hi BA123456  , for Y axis, if you keep it as Auto, then Power BI will plot the axis which may not be always based on your max value. To resolve this, you need to create a measure.For this, I took a small dataset like below:

     

    Then created a measure:

    Max Val per Country =
    VAR _max = SUMMARIZE(Chart, Chart[Period].[Month], "Max_Val", SUM(Chart[Volume]))
    RETURN
    MAXX(_max, [Max_Val]) * 1.2
     
    What this measure does is, based on your slicer selection, it first group by months and then identifies the max value for all the given months. I think for your case, you can replace Chart[Period].Month with your year value. Then once the Max value we have, then simply multiply that with 1.2 factor to make the max level 120% of max value. You may change this factor based on your data.
     
    After that, add that measure in y-axis max value.
     

     

     

     


    If this helps to resolve your problem then please mark it as solution.

    Thanks - Samrat

     

     

    BA123456

  • Royel's avatar
    10 months ago

    Hi BA123456  use the measure and guideline suggested by samratpbi

    Only ensure 2 decimal places for values, since your values are less than 1 million. 

     

    Thanks