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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors