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
Anonymous
Not applicable

Display format mm-yyyy on the chart

Hi every one,


It's a very basic thing. I have to display a bar chart with the date on x axis. I used an hierarchy with Year and Month to be able to show the format MM-YYYY and put a measure on column values. 

Finally, I just have month on the chart and not MM-YYYY. It's important because the month january you can see here belong to 2020 and others months are from 2019 so I must sort correctly the data

Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

Please, can you show me how to fix this ?

1 ACCEPTED SOLUTION

In you date calendar if you create

month year =  format (date[date],"MM-YYYY")

Then you also need sort column to make it sort correctly.

month year Sort =  format (date[date],"YYYYMM")

 

Sort_by_column.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

this might be a bit lazy and not very professional solution but i had the same issue and I created another column in the table and use it instead of the date column (at least while it is the beginning of the year) 

Test = DATE(YEAR(DateKey[Date]),MONTH(DateKey[Date]),DAY(DateKey[Date])+1)
Tahreem24
Super User
Super User

@Anonymous ,

 

You can easily do it by selecting Date Column instead of date hierarchy. Refer below screen shot.

Capture.JPG

 

Don't forget to give thumbs up 👍and accept this as a solution if it helped you.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

@Tahreem24 

your solution could have worked if I choose the format dd-mm-yyyy

I would like to calculate per month so the right format is mm-yyyy

In you date calendar if you create

month year =  format (date[date],"MM-YYYY")

Then you also need sort column to make it sort correctly.

month year Sort =  format (date[date],"YYYYMM")

 

Sort_by_column.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Anonymous
Not applicable

Create calculated column

 new column= format(table[ date column],"MM-YYYY")

 

and use this column for X axis.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Anonymous
Not applicable

@Anonymous 

Hi, thank you for the answer

 

I tried this solution already but it didn't work because this new one is a text string so it won't sort correctly and the format of my attributes date is already MM-YYYY

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.