Forum Discussion

user900's avatar
user900
Helper II
3 years ago
Solved

Chart Help

I have a data file that shows User Name, Status and Department. Using the stacked bar chart, I'm showing the Department on the Y-Axis, count of Users on the X-Axis and Status as legend.  I need to also show a bar for the Enterprise, which essentially adds up the data for all departments. 

 

Any help would be appreciated.

 

UserDepartment
(16 names)A
(4 names)B
(20 names)Enterprise (this is what I need, but there is not a row in the data to show this
  • HI user900 ,

     

    Delete this relationship and everything should work has you need.

11 Replies

  • Hi user900 ,

     

    Don't know how you have the enterprise or if it's more than one but assuming it's only create a tabl with  the departments and a row saying enterprise:

     

    Now add the following measure:

    Total values = 
    SWITCH(
           SELECTEDVALUE(Department[Department]),
           "Enterprise", COUNTROWS(Users), 
           COUNTROWS(
                 FILTER(Users, Users[Department] in VALUES(Department[Department])
                        )
                   )
           )

     

    Nowuse the measure and the new table values to do your chart. If you want you can add an additional column to your new table for sorting the departments and have the enterprise at the bottom of the chart.

    • user900's avatar
      user900
      Helper II

      I created the new table and applied the suggested measure. When I pull the fields into the chart, the counts in each individual department is correct, but Enterprise is blank.  I need it to total all the Users in all Departments.   Here's what it looks like.