Forum Discussion
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
Please, can you show me how to fix this ?
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")
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
6 Replies
- AnonymousNot 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.- AnonymousNot 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
- Tahreem24
Super User
Anonymous ,
You can easily do it by selecting Date Column instead of date hierarchy. Refer below screen shot.
Don't forget to give thumbs up 👍and accept this as a solution if it helped you.
- AnonymousNot applicable
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
- amitchandak
Super User
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")
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
- AnonymousNot 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)