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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
bishophim
Frequent Visitor

Stacked bar chart center aligned (variables average)

My sample dataset contains people from different teams (the filter below), and I want to show each team member's performance compared to the average line. 

 

I read a post 4 years ago, it was wonderful but I couldn't fully copy it.

https://community.fabric.microsoft.com/t5/Desktop/Horizontal-bar-charts-with-custom-center-line/td-p...

 

When I put the average revenue measure in, all data go to "label below 100" (light blue coloured for easy reading)

average revenue measure = [Sales_revenue] / COUNT('sales_teams'[sales_agent])

bishophim_1-1737811888303.png

 

I think it is because the measure itself is already variable, it won't let me use the total average as the reference.

(as you see different people have a different avg revenue)

bishophim_2-1737812017739.png

 

I am not quite sure which step I've gone wrong. 

Is there any way I can use a team average revenue as the centre point, but each team will have a different average? 

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @bishophim 

 

What do you mean by it wont "it won't let me use the total average as the reference"? The vertical line is at around 219K which is the average.

danextian_0-1737813823222.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

Anonymous
Not applicable

Thank you for your prompt reply! danextian 

Hi @bishophim 

You can try changing "
Teamavg_revenue" to the following version.

Teamavg_revenue = 
CALCULATE (
    AVERAGEX ( VALUES ( sales_pipeline[sales_agent] ), [Sales_revenue] ),
    ALLSELECTED ()
)

 

 

vjialongymsft_0-1737943304648.png

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Thank you for your prompt reply! danextian 

Hi @bishophim 

You can try changing "
Teamavg_revenue" to the following version.

Teamavg_revenue = 
CALCULATE (
    AVERAGEX ( VALUES ( sales_pipeline[sales_agent] ), [Sales_revenue] ),
    ALLSELECTED ()
)

 

 

vjialongymsft_0-1737943304648.png

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

danextian
Super User
Super User

Hi @bishophim 

 

What do you mean by it wont "it won't let me use the total average as the reference"? The vertical line is at around 219K which is the average.

danextian_0-1737813823222.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi, thanks for the reply and apologise for the confusion.

I was talking about the graph on the left, which I wanted to use the average as centre point, like below:

bishophim_1-1737868493543.png

 

When I followed the instructions from the post link, it gave me a blank visual, so I turned the label colour on and found all visuals are on Label below 100, which is not what I want to have. 

bishophim_2-1737868698971.png

 

 

Assuming the length of the bars are the same as the actual, please see the attached pbix.

danextian_0-1737879731252.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi, many thanks for the solution. I tried to copy and paste and replace all elements, however it still seems not working in my file.

bishophim_0-1737894262051.png

 

I doubt the problem is from the "Teamavg_revenue" measure, but not sure where it went wrong.

 

Would you mind to have a look to my dataset?

Stacked Bar.pbix

hi @bishophim 

Can you plase accept my post as solution as I was the one who actually provided it?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

AVERAGEX  excludes any column value that doesn't have its respective value. Yours is simply dividing total sales by the count of agents? Are you supposed to include agents without sales in the average?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

You're pointing your measures to the incorrect average. Use the measure that came with my pbix, not the one you initially created..

danextian_0-1737954446394.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors