cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Grand average of column average per category

Hi,

 

I have a dataset reflecting a process where suppliers ("company_ID") submits their offers ("% offered") in a tender round ("bidding_round").

- (1) Firms with 1-499 employees

- (2) Firms with 500+ employees

 

My end goal is to calculate the average price offered for either of the following two segments based on the user's input in another sheet ("Segment chosen?"), subject to two important criteria:

- (1) Only suppliers that have submitted at least 2 prices IN A SEGMET should be included (so supplier 19 and 20 should be excluded in 500+ segment, but supplier 20 should be included in the 1-499 segment where supplier 1 should then be exluded).

- (2) The average should be an average of each firm's average price (so ultimately e.g. 34,10% rather than 34,84% in the 500+ segment).

 

Company_IDBidding_round% offeredEmployeesSegment chosen?
233916,0%660TRUE
333925,1%660TRUE
433942,5%660TRUE
234049,8%890TRUE
235438,0%1200TRUE
435435,6%1200TRUE
335427,3%1200TRUE
135452,0%1200TRUE
234144,4%670TRUE
1933940,3%660TRUE
2035458,3%1200TRUE
2077080%200 
2098985%350 
176582,%100 

 

Any help is greatly appreciated. Thank you.

1 ACCEPTED SOLUTION
Super User IV
Super User IV

OK, I did what I think is correct but not sure. See PBIX.

 

 

Average of the Average = 
    AVERAGEX(
        FILTER(
            SUMMARIZE(
                'Table',
                [Company_ID],
                "__Count",COUNTROWS('Table'),
                "__Average",AVERAGE('Table'[% offered])
            ),
            [__Count] > 1
        ),
        [__Average]
    )

 


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Super User IV
Super User IV

OK, I did what I think is correct but not sure. See PBIX.

 

 

Average of the Average = 
    AVERAGEX(
        FILTER(
            SUMMARIZE(
                'Table',
                [Company_ID],
                "__Count",COUNTROWS('Table'),
                "__Average",AVERAGE('Table'[% offered])
            ),
            [__Count] > 1
        ),
        [__Average]
    )

 


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




View solution in original post

Excellent, worked a charm. Thank you for the fast reply!

Sweet! Always helps to provide the data so thank-you very much for that! You made it easy!


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors