Forum Discussion
Keep Duplicate X-axis Categories on a Graph
- Anonymous2 years ago
Hi Kitty-SD
If you already include legend, then you can only append their IDs to the end of the customer's name if you want to display different customers with the same name on the x-axis, because if there is no specific column (e.g. customer ID), it will be automatically aggregated when you put the same name on the x-axis.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Kitty-SD
You can put the guset id to legend, then close the legend tab in properity.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous thanks for your suggestion. My issue is that a) I already have a legend on the graph that I'd quite like to include (sorry, I should have mentioned this!) and b) adding the Guest ID as the legend seems to make guests with 0 bookings appear at random places in the graph:
This is even after I've sorted the X-axis by booking volume in descending order. This resolves itself once I remove the Guest ID legend.
This is what my original graph looks like; you can see where there are two different guests (belonging to two different loyalty clubs) grouped together:
Thanks,
Kitty
- Anonymous2 years agoNot applicable
Hi Kitty-SD
If you already include legend, then you can only append their IDs to the end of the customer's name if you want to display different customers with the same name on the x-axis, because if there is no specific column (e.g. customer ID), it will be automatically aggregated when you put the same name on the x-axis.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AseelAlLaham8 months agoRegular Visitor
What you’re seeing is expected behavior in Power BI.
A clustered column chart cannot display duplicate X-axis labels. If two guests share the same name, Power BI must treat them as the same category and aggregate their values. Adding a Legend does not fix this—the legend only splits values within a category; it does not create new categories.
So there’s no way to show two different “John Smith” guests as two separate columns while using Guest Name only on the X-axis.
Recommended workaround
Use a Matrix visual to simulate a chart. A Matrix can show duplicate names as separate rows (because the row grain can include a unique key), and you can use Data Bars to get a bar/column-chart look.
This avoids the “Name + ID” concatenated axis labels that look clunky.
How to build it
1) Use a Matrix visual (not a clustered column chart)
2) Put fields in Rows (order matters)
Add these in this exact order:
- Legend field (the field you were using as the chart Legend, e.g., Booking Type / Segment)
- Guest Name
- Guest ID (must be last)
Why:
- The Legend field first preserves the grouping you wanted from the legend.
- Guest ID ensures “same name” guests remain distinct.
- Putting ID last makes it easy to hide visually.
3) Create two separate measures (important)
Even if the calculation is identical, create two measures:
Sum Value = SUM(Bookings[BookingCount])
Bar Value = SUM(Bookings[BookingCount])
Why two measures?
Because conditional formatting (Data Bars) is tied to the field/measure. If you use the same measure twice, Power BI can apply the same data bar formatting to both columns, causing bars to appear in both. Two measures lets you format one as “bars only” and keep the other numeric.4) Add both measures to Values
- Bar Value
- Sum Value
5) Set Matrix layout
In formatting:
- Layout = Outline
- Repeat row headers = Off
This makes the Matrix behave more like a flat list (cleaner, chart-like).
6) Apply Data Bars to Bar Value only
- Conditional formatting → Data bars
- Turn Show bar only = On
Leave Sum Value as plain numeric text.
7) Text/spacing formatting (important for the “chart look”)
In Matrix formatting (Values / Grid):
- Text wrap = Off (prevents row height changes and keeps bars aligned)
- Set fixed small row padding (e.g., 2–4)
- Gridlines color = same as background (e.g., white)
- Turn totals Off (especially for the bar column)
😎 Hide the ID visually (keep it functionally)
- Set Guest ID font color = background color
- Optionally reduce the ID column width
The ID still exists to keep rows unique, but users won’t see it.
Result
You get:
- Separate rows for guests who share the same name
- A bar-style visual per row (via Data Bars)
- Readable labels (no “Name + ID” concatenation)
- Correct logic and filter-safe behavior
Legend note (the only compromise)
You can preserve the legend structure by placing the Legend field first in Rows, but legend colors won’t behave exactly like a clustered column chart. In a Matrix, colors are controlled via conditional formatting rather than automatic legend color mapping.
There is no way in Power BI to have all three at once:
- duplicate X-axis labels,
- automatic legend colors,
- and a true clustered column chart.
Key takeaway
Charts require unique axis categories. When you need duplicate labels shown separately, a Matrix + hidden unique key + Data Bars + (two measures) is the most reliable, model-safe workaround.
I hope this helps, Kitty-SD! Sorry I didn’t catch your question sooner — better late than never, and hopefully this little workaround still comes in handy.
Best regards,
Aseel S. Al-Laham