Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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 ?

6 Replies

  • Anonymous's avatar
    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's avatar
      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

  • 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.

  • Anonymous's avatar
    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)