Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Need help with creating visual

Hi,

 

I have a chart as shown below. Currently there are 4 measures used to show the numbers against a common axis. I am trying to use a field as legend which will segment each bar using that same field. Is that possible. Currently each bar is auomatically assigned a color based on the measure.

 

 

  • Hi, Anonymous 

     

    I understand your needs, but Powerbi doesn't have such a visual. If you place multiple measures on the values, you can't put legend.

    But I have a workaround.

    You need to create a single table using 'enter data' as axis, The number of rows matches the number of your measure.

    Integrate all measures into one measure.

    Measure1 =
    VAR a =
        DISTINCTCOUNT ( Sheet1[order] )
    VAR b =
        SUM ( Sheet1[wt] )
    RETURN
        SWITCH (
            TRUE (),
            MAX ( 'Table'[Column1] ) = 1, a,
            MAX ( 'Table'[Column1] ) = 2, b
        )
    

     

    ā€ƒ

    Modify the y axis setting, hide the y axis manually, and modify the interval.

    This will perfectly reproduce your needs.

    Did I answer your question ? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.

     

    Best Regards,
    Community Support Team _ Janey

     

     

11 Replies

  • Anonymous , You can choose color for each measure or legend under data color

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak : I am looking at segmenting each bar using the same field....something like below

      Example: Product group field used to segment each bar into diff colours 

       

       

      • v-janeyg-msft's avatar
        v-janeyg-msft
        Community Support

        Hi, Anonymous 

         

         

        The settings of these two pictures are different, So what you want to get? I don't quite understand what you mean.

        Can you show a screenshot of visual settings like below? Do you want the same color or a different color?

         

        Best Regards,
        Community Support Team _ Janey