Forum Discussion

Aditi_Saxena's avatar
Aditi_Saxena
Frequent Visitor
3 years ago
Solved

Stacked bar chart

Hello,

I want to make a bar chart regarding employee and manager rating (Picture 3). The way to calculate is (Picture 2):

  1. Distinct count of self-rating.
  2. For manager rating, I want two categories that are represented as stacked bar. First, the employees who have done only manager rating. Second who have done both employee and self-rating.

The important thing to note is, no matter how many skills an employee has gained, the count of self or manager for an employee should be done only once. I have provided the sample data (Picture 1).

Picture 1

 

Picture 2

 

Picture 3

 

Another complication is that I have data of say 30 employees in this table but I need to calculate the above said result only of 20 employees that are mentioned in another table. I have set a relationship with another table to filter out only required 20 employees.

Please suggest how to build this stacked bar chart.

 

 

  • Aditi_Saxena see attached, you can tweak the solution as you see fit.

     

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

    If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️

     

4 Replies

  • Aditi_Saxena see attached, you can tweak the solution as you see fit.

     

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

    If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️

     

    • Aditi_Saxena's avatar
      Aditi_Saxena
      Frequent Visitor

      parry2k I applied this measure but I get an error as follows:
      A single value for column 'Emp' in table 'Rating' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count or sum to get a single result.

      In my case Emp is a column containing email address of employees.
      Could you please help me to get rid of this error.


  • Aditi_Saxena not sure what you are referring to? Which measure? Please provide more details.

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

    If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️

    • Aditi_Saxena's avatar
      Aditi_Saxena
      Frequent Visitor

      Sorry, my bad. I created a measure instead of creating a calculated column.

      The solution you gave worked, thanks!