Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 months ago

Stacked Bar chart with multi legend

Hi,
I have to create this stacked bar chart with multiple legends .Each bar is represents a Doctors visits.
each block in the bar represensts a Visit ID and bar color is based on the vsist type. and I an only able to pull one legend column either Visist ID or Visist Tupe into the "Legend" section. I cant concatenate Visist ID and Type column to create a single column as Visist ID is ID column and will change everyday, Please suggesta solution.

 

 

4 Replies

  • Anonymous unfortunaltey, you cannot have multiple legends in any of the visuals, howdo  you expect the output will look like with multiple legends?

  • Hi Anonymous 

    From a technical standpoint, Power BI supports only one Legend, which is used exclusively for color grouping.
    If you need to display additional descriptive information, you can place a text box above the native legend to simulate a multi-legend layout.

    • From a UX perspective, the chart shown is not an effective way to communicate data relationships:
    • The stacked bars create visual clutter, making it difficult to compare values accurately.
    • There are too many colors for the user to process efficiently.
    • Conceptually, a stacked bar works like a “narrow pie,” showing composition rather than clear absolute comparisons — which can lead to misinterpretation.

    A clearer alternative would be to switch to a table with embedded bar visuals.

    • If the goal is to compare doctors both by total visits and by visit types — the first layout works best.

       

    If the goal is to show the overall share of each visit type within total activity — the second layout is more suitable.

     

    If you need to explore results hierarchically (for example, drilling from Doctor to Patients) — use a hierarchical table instead.

    This approach offers several advantages:

    • Precision: Exact numbers are visible while maintaining a visual cue.
    • Easy ranking: Sorting and comparing categories is straightforward.
    • Low cognitive load: Fewer visual elements mean faster interpretation.
    • Error-proof: Users are less likely to misread proportions or compare unrelated sections.
    • Scalable: Works well even with many categories or sub-categories.


    The pbix with the example is attached

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • v-venuppu's avatar
    v-venuppu
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    Thank you for reaching out to Microsoft Fabric Community.

    Thank you Ritaf1983 parry2k for the prompt response.

    I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.

    Thank you.

  • v-venuppu's avatar
    v-venuppu
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.