cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HamidBee
Post Prodigy
Post Prodigy

How can I reduce the length of the characters on the X-axis?

Hi,

 

I'd like to change the character lengths for the Months like what is below:

 

Data Bars.png

The x-axis is dates from the date table. I'm trying to change the length of the months into what is below:

 

'Jan', 'Feb', 'Mar' etc.

 

I'm wondering is it possible to do this without creating a new column or table.

 

Thank you,

1 ACCEPTED SOLUTION
KNP
Super User
Super User

Honestly, it is probably just easiest to add a short month name column to your date table.

You don't want to change the default format of your date column as it will effect everything.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

View solution in original post

8 REPLIES 8
KNP
Super User
Super User

If you really want to change your date column without adding a column, see below.

KNP_0-1643237093230.gif

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Firstly I have to say I really like the use of the GIF, looks neat. Honestly, it did cross my mind to don this however I have several other charts and tables where I require the full character length of the month names. As a last resort, is it possible to create....a measure using the code that TheoC kindly provided?

TheoC
Super User
Super User

Hi @HamidBee 

 

Easiest way is to create a Calculated Column like this:

 

Column = LEFT ( Table[MonthName] , 3 )

 

If you don't want to do a new column, then click on the Month Name field and the three little dots to the right of it.  Right Click and go to New Group. Then you can name each month whatever you like 🙂

 

TheoC_0-1643236628752.png

 

 

Hope this helps 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

KNP
Super User
Super User

Honestly, it is probably just easiest to add a short month name column to your date table.

You don't want to change the default format of your date column as it will effect everything.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
TheoC
Super User
Super User

Hi @HamidBee 

 

Easiest way is to create a Calculated Column like this:

 

Column = LEFT ( Table[MonthName] , 3 )

 

If you don't want to do a new column, then click on the Month Name field and the three little dots to the right of it.  Right Click and go to New Group. Then you can name each month whatever you like 🙂

 

TheoC_0-1643236628752.png

 

 

Hope this helps 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Thank you for your reply. Is it possible to create a measure instead using the code which you provided?

Hi @HamidBee, unfortunately not in this instance that I'm aware.  If you're adamant on not wanting a column, then go with the New Group approach. However, as flagged, it would be the most appropriate using the new column.

 

Note, @KNP has just provided a gif that can give you a solution to what you want by changing the formatting. That is a simple approach as keeps the current structure of your model the same, too.  I recommend using @KNP's solution.

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

No worries, Thank you for your help. 

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!