Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jcastr02
Post Prodigy
Post Prodigy

Count of Type across multiple columns

I have 5 columns that I split.  The question is "Who explained your roles and responsibilities"   I need to be able to show on visual how many of each one is all 5 columns.  I was thinking a 100% stacked chart to show   ex.  25% human resource, 20% trainer, etc.  See screen shot below. 

 

Roles+Responsibilities.png

1 ACCEPTED SOLUTION
dvstrien
Advocate I
Advocate I

Hi there

I managed to get something like this using the first few rows of your data. 

To get this I had to unpivot the table first so I ended up with a table with just two columns; Attribute (col1, col2 col3 etc.) and Value (trainer, my mom, recruiter etc.)

Next I had to create a measure for each possible value, including blank so you'd need to know every possible answer that people could give. Depending on how the data is collected this may not be possible.

2020-01-08_14h14_25.png

 

I've added the measures to the value section of the 100% stacked bar visualsation while using the Attribute column for the Axis

 

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @jcastr02 ,

 

First you need to go to query editor, choose “unpivot columns”:

 

111.png

 

Then, you need to create 2 measures as below :

Measure = COUNT('Table'[Value])
Measure 2 = 'Table'[Measure]/CALCULATE(COUNTA('Table'[Value]),ALL('Table'))

 

Then you will see :

 

112.png

 

For the related .pbix file,pls click here.

 

Best Regards,

Kelly

dvstrien
Advocate I
Advocate I

Hi there

I managed to get something like this using the first few rows of your data. 

To get this I had to unpivot the table first so I ended up with a table with just two columns; Attribute (col1, col2 col3 etc.) and Value (trainer, my mom, recruiter etc.)

Next I had to create a measure for each possible value, including blank so you'd need to know every possible answer that people could give. Depending on how the data is collected this may not be possible.

2020-01-08_14h14_25.png

 

I've added the measures to the value section of the 100% stacked bar visualsation while using the Attribute column for the Axis

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.