Forum Discussion

willfrancis's avatar
willfrancis
Frequent Visitor
10 months ago
Solved

Group x-axis by month

Hi PowerBI fam,   I am building a chart in PowerBI to allow managers to check the productivity of their staff each month. The current version is shown in the first image. When I try to replicate th...
  • DataNinja777's avatar
    10 months ago

    Hi willfrancis ,

     

    What you are experiencing in Power BI is a common behavior called concatenation, where the axis combines the text from the Line Manager Name and Month fields. To get the grouped format you're looking for, you need to create a hierarchical axis.

     

    To achieve this, you should arrange the fields in the X-axis well based on the desired hierarchy. Place the Date - Month field at the top, followed by the Line Manager Name field directly below it. The order here is very important. Once they are in the correct order, look for the icons at the top-right of your chart visual and click the "Expand all down one level in the hierarchy" button, which looks like a forked arrow pointing downwards. This will switch the axis from a single concatenated label to the grouped structure you want, showing each line manager nested within their respective month.

     

    After expanding the hierarchy, you may need to adjust the sorting. Power BI sometimes defaults to sorting months alphabetically rather than chronologically. To correct this, click the three dots (...) on the visual, navigate to Sort axis, and ensure you are sorting by the Date - Month field in Ascending order. If the sorting is still incorrect, you may need to go to the Data view, select your month column, and use the "Sort by column" feature in the Column tools tab to sort it by a numerical month column.

     

    An alternative method that closely resembles your target chart is to use the Small Multiples feature. This will create a separate mini-chart for each month, which can make the data easier to read. To do this, you would place only the Line Manager Name in the X-axis well and then drag the Date - Month field into the Small multiples field well in the Visualizations pane. This can provide a very clear and effective view of productivity across different months.

     

    Best regards,