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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
AlsoKnownAsJazz
Regular Visitor

Stacked Bar, two with series' 0 Sum(CompanyX Hours), Avg(Sum(All Companies Hours)) by Month

New to Power BI (like, day 2), maybe what I'm trying to do isn't possible or doesn't even make sense. I'm used to SSRS reports, where I'd write the SQL that gave me what I wanted, and then I could display it almost any way I wanted. I've spent the last three hours experimenting and Googling... and reading articles on this forum. Could be that I don't know how to phrase what I'm looking for effectively, but I haven't found a result that addresses my use case.

 

Below is some sample data, and a quasi-mock up of the bar graph I want. The idea is for the consumer of the report to pick a company, and see it compared to the average of all companies. For example, say I worked 80 hours for Microsoft, while the average of the other companies is 30, maybe I should take a closer look at what I'm doing for Microsoft. I can get the sum of hours for one client by filtering at the page or visual level. What I can't get is the average of all companies (i.e. ignore the page filter, but only on ONE of my series. I did see the ALL and ALLEXCEPT functions but either I implemented it wrong, or it's not the right approach.

 

First, I tried adding a measure, as a second series:

CALCULATE(AVG('Time_Entry'[Agr_Hours]), ALL())

This gave the average time per entry when I want the average sum per month. 

 

So, I tried something like this, and from what I gather you can't double-up aggregates in a measure.

CALCULATE(SUM(AVG('Time_Entry'[Agr_Hours]), ALL()))

 

Only thing I can think of to try next is to make a pre-aggregated table; sum the hours by 'company' and by 'monthyear' and then I could add a measure for Avg(Hours) - but that feels like cheating instead of learning the right way.


PowerBIDemo.png

1 REPLY 1
datawailor
Advocate II
Advocate II

What you're asking if I understand you correctly, is to be able to benchmark a selected company with the rest. Then since your data is at the hourly grain, you'd like to be able to compare at a monthly level..

first I would work on getting the "Averages" right by not using Average but perhaps dividing the metric by the total number of hours in the months included to get the Monthly average.

On the benchmarking aspect, you'd most likely need to use the element of what is called a disconnected table (look it up) to create a list of all companies (probably create a table using the DISTINCT DAX expression to create it and then use the SELECTEDVALUE DAX expression to isolate any aggregations based on that selection with aggregates based on all customers. Not something easy to describe here but I can tell you it is possible.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.