Forum Discussion

RyanThorsen's avatar
RyanThorsen
Frequent Visitor
1 year ago
Solved

Stacked Bar Chat with 2 Measures

Hi, I am trying to create a bar chart with 2 measures side by side in Power BI and can't figure it out. Below is what I am trying to accomplish. I tried even creating a measure in Power BI that pulls both Measures together (below) and that works fine with a Matrix, but I can't get it to work for a bar chart, any thoughts?

Combined Measure =
    switch(
        true(),
        SELECTEDVALUE('xxx) = "Y",  format([% Total], "0.0%"),
        SELECTEDVALUE(yyy) = "N", format([count], "#,0")
        )

 

  • Hi,

    No, that won't work. Play around with charticulator. By using this, you can have very customized visuals for your needs. A good tutorial and other examples you can get from:

    https://www.youtube.com/watch?v=100RnpiOgYA&t=3s

    Regards,

    Oktay

     

    Did I answer your question? Then please mark my post as the solution.

    If I helped you, click on the Thumbs Up to give Kudos.

3 Replies

  • OktayPamuk80's avatar
    OktayPamuk80
    Responsive Resident

    Hi Ryan,

    I think you are trying to get measures to be in the legend part of a bar chart. That won't work. It will only work if you have a dimension (non calculation field). There is a nasty workaround to get that. This depends on your datamodel of you need complicated dax.

    I would go using a matrix or table using option Cell elements-> Data bars. By this you can have the bars in the cells and by customizing the grid options (higher rows, wider measure columns, you can achieve a performant and pleasing result.

    Regards,

    Oktay

     

    Did I answer your question? Then please mark my post as the solution.

    If I helped you, click on the Thumbs Up to give Kudos.

    • RyanThorsen's avatar
      RyanThorsen
      Frequent Visitor

      Thanks, is there a way to change the colors of the data bars in a matrix or do they all have to be the same? I see you can change the positive and negative, but i'd like to have them like the legend colors in my example above, not sure if that is possible in a matrix?

  • OktayPamuk80's avatar
    OktayPamuk80
    Responsive Resident

    Hi,

    No, that won't work. Play around with charticulator. By using this, you can have very customized visuals for your needs. A good tutorial and other examples you can get from:

    https://www.youtube.com/watch?v=100RnpiOgYA&t=3s

    Regards,

    Oktay

     

    Did I answer your question? Then please mark my post as the solution.

    If I helped you, click on the Thumbs Up to give Kudos.