Forum Discussion

MPetramalo21451's avatar
MPetramalo21451
Frequent Visitor
2 years ago
Solved

Non-Aggregated Bar Chart with Legend

I have a weirdly specific request for a type of visual.  I've gotten it mocked up in Python, but we're on the Report Server and we don't have the Python visuals enabled in Power BI, so I'm trying to see if there is a way to do this natively in Power BI.  

 

We have a varying number of events that occur each month, and they fall into one of two categories.  The user wants to have each event show up as its own bar, and colored based on which group it falls into.  Power BI is automatically aggregating the events into two bars when I assign the group as the Legend.  And when I assign a custom column that looks at what # event it is in the month, so they each show up separately, I don't see an option to do conditional formatting colors on the bars. 

 

Anyone have any ideas on if this is able to be accomplished within Power BI? 

Python Visual with Dummy Data:

 

  • Hi MPetramalo21451 

     

    You can try this. It may work

     

    • Open a bar cahrt
    • In the X axis add in this order  Year, Month, EventID
    • Then add the measure to the Y axis
    • Add the category field to the legend

    Hope this helps

    Joe

2 Replies

  • Hi MPetramalo21451 

     

    You can try this. It may work

     

    • Open a bar cahrt
    • In the X axis add in this order  Year, Month, EventID
    • Then add the measure to the Y axis
    • Add the category field to the legend

    Hope this helps

    Joe

    • MPetramalo21451's avatar
      MPetramalo21451
      Frequent Visitor

      Yup, that was it! I didn't even think to add an extra level to the hierarchy.  Thank you!