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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Have to show first 3 letters of months in hierarchy

Hello Folks,

 

I have to show first 3 letters of every months in graphs

Have created separate columns but when I add in hierarchy month order  is not coming correct like for 2020 and 2021 jan showing at first 2020 jan then 2021 jan then 2020 feb, 2021 feb like this 

but have to show 2020 Jan, 2020 Feb.........2021 Jan,2021 Feb like this.

 

below is system defined hierarchy.

Need help please 

 

 

shankarshiva70_0-1615292062855.png

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

You may create following column to replace the original date hierarchy: 

 

Column = CONCATENATE([Date].[Year],CONCATENATE(" ", LEFT([Date].[Month],3)))
 
V-pazhen-msft_0-1615446547607.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Anonymous 

You may create following column to replace the original date hierarchy: 

 

Column = CONCATENATE([Date].[Year],CONCATENATE(" ", LEFT([Date].[Month],3)))
 
V-pazhen-msft_0-1615446547607.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

Hi,

 

I used the Calcualted Column and it showing the expected Month Format, but I couldn't achieve the X-Axis format as shown in the image.

 

Do we have any option to achieve the X-Axis

 

Thanks in Advance,

Mani2E0BC81D-2C1E-43F6-B361-06C927785186.jpeg

edhans
Super User
Super User

You need to add another column to your date table that is in this format:

 

MonthName SortCode
Jan 2020 202001
Feb 2020 202002
Mar 2020 202003

Jan 2021

202101

Feb 2021

202102

 

Etc. I've left off a lot of data obviously. The following formula as a Custom Column in Power Query will do this:

Date.Year([Date]) * 100 + Date.Month([Date])

I have a date table here with this kind of info - Creating a Dynamic Date Table in Power Query

 

You then sort the MonthName column by the SortCode above. This article has more details on that procedure.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors