Forum Discussion

BIUser1998's avatar
BIUser1998
Icon for Helper I rankHelper I
2 years ago
Solved

Compare one category vs All

I have some data that looks something like the one showed below and I want to compare the count of all the classes vs class A on a bar chart with Type acting as a fill / legend.

 

I created two measures as

All = COUNT(ID)

Class A = CALCULATE(COUNT(ID), Classification = "A")

 

and put it on a clustered bar chart. But when I try and drag the Type column on to the legends field. It does not accept it. Is there any way to work around this? Any help would be appreciated. Thank you

 

 

IDTypeClassification
81238239803CallA
89321897312CallB
35498754398EmailA
89789433498CallB
43934980987EmailB
38987324897EmailA
  • BIUser1998's avatar
    BIUser1998
    2 years ago

    Luckily I was able to convince my team to go ahead with this solution. Thank you so much for the input!

5 Replies

  • Good afternoon BIUser1998 ,

     

    Not the cleanest solution but you could create a calculated column with an IF statement and override all other classes that aren't 'A' into their own bucket, essentially creating a small hierarchy and then you would be able to plot that single column on your visual

    • BIUser1998's avatar
      BIUser1998
      Icon for Helper I rankHelper I

      Greg_DecklerThank you for the suggestion. I tried putting the Type in Y-Axis but in that case its creating multiple bars instead of the two I want which should include the fill. Its not a hard requirement that I need to stick with Clustered Bar Chart. Anything that would fulfil the requirement would work. Thank you!

      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        BIUser1998 Well, the issue is that you have 2 metrics and that kind of disables the Legend field. Perhaps if you provided an image, even hand-drawn, of what you are looking to achieve? Because I can't picture it in my head.