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
dhestarwirawan
Frequent Visitor

Total Sum of Grouped Average

Hi everyone,

 

I have the data with a structure like this

dhestarwirawan_2-1714988131290.png

 

I want to create summary like below table (let's call this summary table😞

dhestarwirawan_1-1714987947190.png

Where the GOE equals to Opex divided by Sum of Grouped Average TWPI.

For the Sum of Grouped Average TWPI, I wrote the DAX as below (I average the TWPI based on the Business column, and then sum all the grouped average):

Sum of Grouped TWPI = SUMX(SUMMARIZE(
    'Sheet1','Sheet1'[Business],"Total TWPI" ,AVERAGE('Sheet1'[TWPI])),[Total TWPI]
)
 
The above DAX is works for per company results, but does not work for total. In the summary table above, the total should be 21,828,883.
 
How to get the correct total sum amount for the TWPI?
 
Thanks!
1 ACCEPTED SOLUTION
samratpbi
Super User
Super User

Hi, first of all, I created a small subset of your table like below:

samratpbi_0-1714991878508.png

Then for for average TWPI, created below measure:

AvgTWPI =
IF(ISFILTERED(SumAvg[Period]),
    AVERAGE(SumAvg[TWPI]),
    SUMX(
        ADDCOLUMNS(
            SUMMARIZE(
                SumAvg,
                SumAvg[Period],
                SumAvg[Company]),
            "Avg_TWPI",
            AVERAGE(SumAvg[TWPI])
            ),
        [Avg_TWPI])
)
and the output is below:
samratpbi_1-1714992009009.png

It is taking sum of average fields.

If this helps to resolve your problem then please mark it as solution provided, thanks!

View solution in original post

1 REPLY 1
samratpbi
Super User
Super User

Hi, first of all, I created a small subset of your table like below:

samratpbi_0-1714991878508.png

Then for for average TWPI, created below measure:

AvgTWPI =
IF(ISFILTERED(SumAvg[Period]),
    AVERAGE(SumAvg[TWPI]),
    SUMX(
        ADDCOLUMNS(
            SUMMARIZE(
                SumAvg,
                SumAvg[Period],
                SumAvg[Company]),
            "Avg_TWPI",
            AVERAGE(SumAvg[TWPI])
            ),
        [Avg_TWPI])
)
and the output is below:
samratpbi_1-1714992009009.png

It is taking sum of average fields.

If this helps to resolve your problem then please mark it as solution provided, thanks!

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.