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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
SUMESHKUMAR22
Helper IV
Helper IV

Matrix Column Grand Total fix

Hi Community,

Need a urgent help!

In the below highlighted estimated spend horizontally the Grand Total Estimated Hrs is coming average but it should be Sum
(e.g. For account management,  instead of 72.70 it should be 145 (in grand total estimated hrs). 


Thanks in advance!

1 ACCEPTED SOLUTION

Well, there's your problem. It's defined as the sum of averages over departments.

 

If you want it to sum over whatever dimension you're using on columns (phase?), then that needs to be part of the definition. For example,

VAR esthrs =
    SUMX (
        SUMMARIZE (
            INTERNAL__PROJECT_MANAGEMENT__BENCHMARK,
            INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[DEPARTMENT_NAME],
            INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[PROJECT_PHASE], /* <-- New line here */
            "AvgEst", AVERAGE ( INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[ESTIMATED_HOURS] )
        ),
        [AvgEst]
    )

View solution in original post

8 REPLIES 8
SUMESHKUMAR22
Helper IV
Helper IV

@AlexisOlson , ok! The user is actually drilling down & up at row level

(department-> employee and viceversa) .

So , do that affect the above logic?? Any changes in measure required?

thanks!

AlexisOlson
Super User
Super User

How is the measure defined?

@AlexisOlson , there is a option in matrix for column grand total. So its auto created because of that. & Estimated hrs measure is:

Estimated hrs =
VAR _check =
    INT (
        NOT ISINSCOPE ( INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[EMPLOYEE_NAME] )
            && ISINSCOPE ( INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[PROJECT_PHASE] )
    )
VAR _check2 =
    INT (
        NOT ISINSCOPE ( INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[EMPLOYEE_NAME] )
            && ISINSCOPE ( INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[PROJECT_PHASE] )
            && NOT ISINSCOPE ( INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[DEPARTMENT_NAME] )
    )
VAR esthrs =
    SUMX (
        SUMMARIZE (
            INTERNAL__PROJECT_MANAGEMENT__BENCHMARK,
            INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[DEPARTMENT_NAME],
            "AvgEst", AVERAGE ( INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[ESTIMATED_HOURS] )
        ),
        [AvgEst]
    )
RETURN
    IF ( _check = 1, esthrs, esthrs )

Well, there's your problem. It's defined as the sum of averages over departments.

 

If you want it to sum over whatever dimension you're using on columns (phase?), then that needs to be part of the definition. For example,

VAR esthrs =
    SUMX (
        SUMMARIZE (
            INTERNAL__PROJECT_MANAGEMENT__BENCHMARK,
            INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[DEPARTMENT_NAME],
            INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[PROJECT_PHASE], /* <-- New line here */
            "AvgEst", AVERAGE ( INTERNAL__PROJECT_MANAGEMENT__BENCHMARK[ESTIMATED_HOURS] )
        ),
        [AvgEst]
    )

@AlexisOlson , Thanks for the info.

I want to get the sum of averages in Grandtotal ( across rows and columns for estimated hrs). So I achieved that for department level (vertically) but at horizontal level its still average. So what modification should be done in my existing measure to get sum of average horizontally?

 

 

As I mentioned, you need to include whatever dimension that is as one of the columns you're averaging over before summing. My example was assuming PROJECT_PHASE was the appropriate dimension.

Ok!

lastly, the users can drill down to employee level for each department and viceversa (at row level). So does that need any further modification in measure apart from 'phase'?

 

Make sure the measure reflects the intended business logic. If there are other dimensions involved (like employee), you need to decide how you expect to see the total. Should it be an average of the rows/columns or a weighted average?

 

Ideally, your SUMMARIZE should include the most detailed level(s) you want sum over; then it should add up for all levels in a hierarchy above that detail level. Once you get the measure defined right, it should work in any context.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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

Users online (9,538)