Forum Discussion

JohannTTG's avatar
JohannTTG
Helper I
6 years ago
Solved

Histogram - space for empty bars

Hi,

I have a histogram. The x-axis shows the years, the y-axis some values.

Now the user can select the years with checkboxes (multiple selection).

 

If the user selects consecutive years (e.g. 2017, 2018, 2019) all is fine.

But if the user does not select some years in the middle then the value of the years are not displayed (that's ok) but on the x-axis the left-out years are shown and some space for the left-out years is reserved.

 

E.g. the user just wants to compare year 2017 and 2019. So he only selects these years. But in the histogram 2018 is still on the x-axis as empty space. How to turn of this behavior?

 

Any help is apprecited - thanks! JohannTTG

  • Hi, JohannTTG 

     

    Based on your description, I created data to reproduce your scenario.

    Table:

     

    You may create the 'Year' column as below. Its data type is text.

    Year = FORMAT('Table'[Date],"yyyy")

     

    Result:

     

    Best Regards

    Allan

     

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

     

  • JohannTTG's avatar
    JohannTTG
    6 years ago

    Thank you - your suggestion showed me the way. I convert the x-axis-number to text and this does the job!

6 Replies

  •  

    As screenshot for clarification: I don't want to see 2016 and 2018

    • amitchandak's avatar
      amitchandak
      Super User

      JohannTTG ,  Does you measure/formula has +0. if so remove and check.

      Otherwise.

      Can you share sample data.

      • JohannTTG's avatar
        JohannTTG
        Helper I

        Thanks for your quick reaction.

         

        There are values > 0 for every (!) year. All the user wants is to remove the gaps for non-selected years.