Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have an additional column added to my "years" table which is only the last 2 digits of the year because that's the format of the chart I need to make. However, when set as "whole numbers" power bi automatically removes any leading 0's. I need to keep the leading 0s. So I changed the data type to "text". Problem solved, however, now I am unable to set the start/end of the range of the x-axis and I get a scrollbar along it. Is it possible to have the "whole numbers" data type and retain the leading 0s? Or vice versa, is it possible to have the "text" data type and show the full range without the scrollbar?
Here is an image if it's helps explain it better:
Solved! Go to Solution.
Hi @kcsteele ,
Here are the steps you can follow:
1. Enter into Mode
2. Click on the column [YearTrunc] of the yearsTest table and select Formatting.
Format – Custom
Custom -- 00
3. The column [YearTrunc] becomes the format with 0 in front, and it is also an whole number.
4. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @kcsteele ,
Here are the steps you can follow:
1. Enter into Mode
2. Click on the column [YearTrunc] of the yearsTest table and select Formatting.
Format – Custom
Custom -- 00
3. The column [YearTrunc] becomes the format with 0 in front, and it is also an whole number.
4. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi v-yangliu-msft,
Brilliant! It worked.
You can use the filters in the filter pane to establish the range for the visual
Proud to be a Super User!
Paul on Linkedin.
still get the scrollbars
To avoid the scrollbars the axis must be set as continuous.
You can share a file by sharing the link to the file in OneDrive, Google Drive, Dropbox...
Proud to be a Super User!
Paul on Linkedin.
I gave a google drive link. Thanks again!
you could create two fields, put the text on the axis as you have but then use the other fields to filter your text field? problem is, you want number functions with text so thats not gonna work. you would also just use a date table and then have a text field in that date table which you can also filter using a date - although i might misunderstand what are you trying to set a range for
Proud to be a Super User!
Thanks, I need to retain the actual data points on the line however and if I filter out any years I believe those "dots" will disappear. The problem is resolved if I simply make the chart larger, because the scroll bar goes away and all the years show.
I'm trying to keep the chart at the same size and keep all the data points, and also retain the full x-axis range without the scrollbar. All the years do not need to show on the x-axis, I just need all the data points without the scroll bar. Ideally it would show only every 2 or 5 years on the x-axis (00, 05, 10, 15, 20) or (00, 02, 04, 06, 08 etc) but keeping the data points on the line. (I can achieve this when it's set to whole numbers, but then power bi removes the leading 0s...)
I guess I can just make a mock-image of what the x-axis should look like and just place it over the graph?
if you are able to share some data or dummy data then i could try mock something up
Proud to be a Super User!
I would like to attach the .pbix but I don't see an option to do that. Here is a google drive link
https://drive.google.com/file/d/1It2Ltp6aIyqDznLxe2GtKYZzM6sYCpG-/view?usp=sharing
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
69 | |
55 | |
36 | |
31 |
User | Count |
---|---|
87 | |
62 | |
61 | |
49 | |
45 |