Forum Discussion

Avivek's avatar
Avivek
Icon for Post Partisan rankPost Partisan
6 years ago
Solved

Add another legend in the clustered column chart

I have a column chart which has Used/Shared which is a calculated column and count of tag id as the column values and it appears as shown below.   Now I want to add another series to the colu...
  • Greg_Deckler's avatar
    6 years ago

    Avivek - I did something like this once. Used a stacked column chart. I think I had to do some math to get it to come out right. Will depend on your data. Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

    Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

  • v-lili6-msft's avatar
    6 years ago

    hi Avivek 

    When you drag a filed into Legend of the visual, you could only put one measure into Values. 

    so for your case, you could try this way as below:

    Step1:

    Create two measure instead of draging [Used/Shared] and [Tag ID] into visual.

    Shared = CALCULATE(COUNTA('Table'[Tag ID]),FILTER('Table','Table'[Used/Shared]="Shared"))
    
    Used = CALCULATE(COUNTA('Table'[Tag ID]),FILTER('Table','Table'[Used/Shared]="Used"))

     

    and now you could drag these two measure and another new measure into Values, do not drag a filed into Legend.

     

    This will work for your case. 

     

    Regards,

    Lin