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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
Greg_Deckler
Super User
Super User

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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