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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.