Forum Discussion

mc625569's avatar
mc625569
Regular Visitor
9 years ago
Solved

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 an...
  • Sean's avatar
    9 years ago

    mc625569

     

    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: