Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
JohannTTG
Helper I
Helper I

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

2 ACCEPTED SOLUTIONS

Hi, @JohannTTG 

 

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

Table:

b1.png

 

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

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

 

Result:

b2.png

 

Best Regards

Allan

 

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

 

View solution in original post

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

View solution in original post

6 REPLIES 6
JohannTTG
Helper I
Helper I

image.png

 

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

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

Otherwise.

Can you share sample data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

 

image.png

If I look at the data as a table then I do not see data for the not-selected year.

image.png

 

Hi, @JohannTTG 

 

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

Table:

b1.png

 

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

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

 

Result:

b2.png

 

Best Regards

Allan

 

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

 

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.