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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
user900
Helper II
Helper II

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
1 ACCEPTED SOLUTION

HI @user900 ,

 

Delete this relationship and everything should work has you need.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

11 REPLIES 11
MFelix
Super User
Super User

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:

MFelix_0-1671131236925.png

 

Now add the following measure:

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

MFelix_1-1671131323059.png

 

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.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.

user900_1-1671627136191.png

 

 

Hi @user900 ,

 

Can you share the metric formula please.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



user900_0-1671630163072.png

 

HI @user900 ,

 

Delete this relationship and everything should work has you need.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



I have another request to add a breakdown by the highest status. I created measures to get the counts for each of the 4 statuses. However without a relationship to the new Department table, it shows all the same results for all the departments. Can you help so that I can get the results by department, while still keeping Enterprise-Wide. 

How are the status related with the line of business 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Line of businesss is one table (you suggested I create a table and add a row for Enterprise-wide.) Status is in a seperate table with users.

Thank you so much!

Total values =
SWITCH(
SELECTEDVALUE('LOB order'[Line of Business]),
"Enterprise-Wide", COUNTROWS('Colleague Data'),
COUNTROWS(
FILTER('Colleague Data', 'Colleague Data'[Line of Business] in VALUES('LOB order'[Line of Business])
)
)
)

Hi @user900 ,

 

Base on the syntax everything should be correct, please verify if there is an active relationship between both tables, the table that you created with the enterprise, needs to bve a disconnected table from the other ones on the model.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.