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 ...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    4 years ago

    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