Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Create a clustered column chart from counting text values in various columns

I am trying to create a clustered column chart that shows the count of each score from 9 different categories: 

 

SAF           W            M           SYS       ERM     ENV         COM        ET        SCH

EHEEHEEEEEE
HEEHEEEEHEEE
ENEENENEEEEE
EEEEEEHEEE
EEEEHEEHEHEE
NEEEEEEEEE
NEEEEEEHEEE
EEENEEEEEE
ENEENEEEEHEE
NEHEEEHEEEEE
ENEENENEEEEE
EEEEHEEEEE
NENENENEEEEEE
ENEENENEEEEE
ENEHEEEEEEE
EEEEHEEEEE
ENEEEEENEEE
EEENEHEENEHEE
NEEEEEEEEE
ENEEEEEEEE
ENEEEEEEEE
EEEEEEHEENE
NENEEEHEEENEE
EEEEEEEHEE
NEEEEEEEEE
NENEEEEENEEE
NEEENEEEHENEE
EEENEEEENENE
EEEEEEEHEE
EEHENEEEEEE
NEEEENEEEEE
NEEEEHEEEEE
EEEEEENEEE
EEEENEEEENE
EEEHEEEEEE
ENEEEEENEEE
NEEEEEEEHEE
EEENEEEEEE
HEEEEEEEEE
EUSENENEEEEE
ENEEEEEHEEE
EEEEEEEEE
NEEEEEEEEE
EEENEEEEHEE
EUSENENEEEEE
USNEEEEEEEE
EEEEEENEEE
ENEEEEEEEE
NEEEEHEEEEE
NEEENEEEEEE
EENENEEEEEE
EEHEEHEEEEE
NEEEEEEEEE
NEEEEEEEEE
EEEEEENEEE
NEEEEEEEEE
EHEEEEEHEEE
NENEENEEEENEE
EEEEHEEEEE
EEEEEEEEE
EHEEEEEEEE
ENEEEEENEE
HEEEEEENEEE
EEEEEEEEE
EUSEEEEENEE
HEEHEEEEEEE
NEEEEEEEEE
EEHEEEEEEE
NEUSEENEEEEE
EEENEEEENEE
NEEEEEEEEE
NEEHEEEEEEE
NEEHENEEEEEE
NEEEEEENEEE
NEEHENEEEEEE
USEEHEEEEEE
EUSENENEEEEE
NEEEEEEHEHEE
NEEENEEEEEE

 

I've tried pivoting, unpivoting, summarizing, creating measures that count the 5 scores (HE, E, N, NE, US) in each category and then throwing them all into the various fields but it never turns out how I want it. I want the categories (top) to be on the axis, and a count of the various scores for each category to be the bars. How can I achieve this?  Thanks!

  • Hi Anonymous,

     

    For your requirement, you could unpivot all your columns and change the Attribute to Category then you will get the table like this .

     

     

    Then you could create the measures below.

     

    E = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="E"))
    HE = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="HE"))
    N = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="N"))
    NE = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="NE"))
    US = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="US"))

    Then you could create the visual below.

     

     

    More details, please refer to this attachment.

     

    Best  Regards,

    Cherry

3 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi Anonymous,

     

    For your requirement, you could unpivot all your columns and change the Attribute to Category then you will get the table like this .

     

     

    Then you could create the measures below.

     

    E = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="E"))
    HE = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="HE"))
    N = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="N"))
    NE = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="NE"))
    US = CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="US"))

    Then you could create the visual below.

     

     

    More details, please refer to this attachment.

     

    Best  Regards,

    Cherry

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-piga-msft That worked! Thank you so much!

      • v-piga-msft's avatar
        v-piga-msft
        Resident Rockstar

        Hi Anonymous ,

         

        It's glad that we can help.

         

        Please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

         

        Best Regards,

        Cherry