Forum Discussion
change change data label text in chart
Hello,
We are using a bar chart that displays the "count" of a number of different variables.
Is there a way to abbreviate the text labels in the legend - our column names are quite long and seeing "count of <XYZ>" doesn't fit in the allocated space.
I'd like to remove the words "Count of" in the legend, but leave the data as it is.
Is this possible?
thanks.
MC
You normally get this generic Count Of... - when you drag a field (that is not data type number) to the Values area of your chart
What you need to do is write a Measure that duplicates this behavior.
You can then name it whatever you wish and use it in the Values area of your bar chart instead
Regarding which COUNT function to use - you'll have to tell us more what you want to count and how
In general COUNTROWS count all rows, COUNTA does not count blanks so...
COUNTROWS (Table) = COUNTA( Table[Column] ) + COUNTBLANK ( Table[Column] )
And if you need a distinct count you can use DISTINCTCOUNT ( Table[Column] )
Now you can also wrap either one of those in CALCULATE and add additional FILTERS...
Good Luck! :smileyhappy:
2 Replies
- parry2k
Super User
You can change the default summarization for the your column, in this case, if you make it count then you will not see "Count of field name"
To do so, go to modelling tab and select your field and change default summarization to count
- Sean
Community Champion
You normally get this generic Count Of... - when you drag a field (that is not data type number) to the Values area of your chart
What you need to do is write a Measure that duplicates this behavior.
You can then name it whatever you wish and use it in the Values area of your bar chart instead
Regarding which COUNT function to use - you'll have to tell us more what you want to count and how
In general COUNTROWS count all rows, COUNTA does not count blanks so...
COUNTROWS (Table) = COUNTA( Table[Column] ) + COUNTBLANK ( Table[Column] )
And if you need a distinct count you can use DISTINCTCOUNT ( Table[Column] )
Now you can also wrap either one of those in CALCULATE and add additional FILTERS...
Good Luck! :smileyhappy: