Forum Discussion
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
| ID | Type | Classification |
| 81238239803 | Call | A |
| 89321897312 | Call | B |
| 35498754398 | A | |
| 89789433498 | Call | B |
| 43934980987 | B | |
| 38987324897 | A |
Luckily I was able to convince my team to go ahead with this solution. Thank you so much for the input!
5 Replies
- hvnter
Resolver I
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
- Greg_Deckler
Community Champion
BIUser1998 If it is a clustered bar chart, you need to use the Y-Axis field instead of the Legend field.
- BIUser1998
Helper 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
Community 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.