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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.