Forum Discussion

cmccarra's avatar
cmccarra
Frequent Visitor
8 years ago
Solved

How to order dates chronologically on graph x-axis

Hi,

I have a Power BI report connected live to an azure analysis services cube. In the cube I have a column for email 'sentdate' (which is a complete date and timestamp), 'daysent' (1-31), 'monthsent' (index from 1-12) and 'yearsent' (2017, 2018).

 

I want to create a graph of average email open rate by month (using the 'monthsent' column). This works fine when I keep the date range within the same year, however if I want to look at say November 2017 - June 2018, the graph doesn't follow chronologically as the axis is by index so it puts 11,12 at the far right when what I actually want is to to go from Nov-17, Dec-17, Jan-18 etc.

 

Is there a way to do achieve what I want using the columns I already have? The live connection limits a lot of the easy solutions.

 

Thanks

Connor

  • Hi cmccarra,

    Based on my test, you can refer to below steps:

    1.Create a Clustered column chart and add the [month] and [avg] fields.

    2.Put the [year] field before the [month] and use the “Expand all down one level in the hierarchy” function in the visual. Now you can see the correct result.

    Regards,

    Daniel He

2 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi cmccarra,

    Based on my test, you can refer to below steps:

    1.Create a Clustered column chart and add the [month] and [avg] fields.

    2.Put the [year] field before the [month] and use the “Expand all down one level in the hierarchy” function in the visual. Now you can see the correct result.

    Regards,

    Daniel He

    • cmccarra's avatar
      cmccarra
      Frequent Visitor

      Hi v-danhe-msft, thanks for your reply. I tried what you described before but I still ended up with the graph starting at Jan-2018. I followed your guide and this happended again but I then clicked on the 'Sort By YearSent MonthSent' option from the visual dropdown menu twice and got the desired results. The sort by option seems a bit temperamental, it took a few clicks on some graphs to get it sort correctly.

       

       

       

      Thanks for your help!