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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
xeniaay_2
New Member

How to fix the incorrect total rolled up to the previous levels in a Matrix Table

Hi

 

I'd really appreciate if someone can help me in figuring out the solution to solve this problem about incorrect total rolled up to the previous levels in a Matrix Table.  I have a data table like the following which has column A to C put into Rows of a Matrix Table and column D to F put into the Value field of a Matrix Table.  The Total to the 3rd level i.e. the Project level is correct but the Total rolled up to the 2nd level - Resource and 1st level - CIO are incorrect.  I've used a DAX measure: Average Available = AVERAGEX(ALLEXCEPT(YourTableName, YourTableName[CIO], YourTableName[Resource], YourTableName[Project]), CALCULATE(AVERAGE(YourTableName[Available]))) that works well at the lowest level but it's incorrect at the 2 higher levels.

 

Screenshot 2024-08-20 1.png

What should be the correct DAX measure that can resolve the incorrect totals for the Average & Percentage columns?

 

Thank you!

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@xeniaay_2 ,

To calculate the average correctly at each level, you can use the AVERAGEX function along with SUMMARIZE to ensure that the average is calculated based on the correct context.

Average Available =
AVERAGEX(
SUMMARIZE(
YourTableName,
YourTableName[CIO],
YourTableName[Resource],
YourTableName[Project],
"AvgAvailable", CALCULATE(AVERAGE(YourTableName[Available]))
),
[AvgAvailable]
)

 

For Percentage

Total Available =
SUM(YourTableName[Available])

Percentage Available =
DIVIDE(
    [Total Available],
    CALCULATE(
        [Total Available],
        ALLEXCEPT(YourTableName, YourTableName[CIO], YourTableName[Resource])
    ),
    0
)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@xeniaay_2 ,

To calculate the average correctly at each level, you can use the AVERAGEX function along with SUMMARIZE to ensure that the average is calculated based on the correct context.

Average Available =
AVERAGEX(
SUMMARIZE(
YourTableName,
YourTableName[CIO],
YourTableName[Resource],
YourTableName[Project],
"AvgAvailable", CALCULATE(AVERAGE(YourTableName[Available]))
),
[AvgAvailable]
)

 

For Percentage

Total Available =
SUM(YourTableName[Available])

Percentage Available =
DIVIDE(
    [Total Available],
    CALCULATE(
        [Total Available],
        ALLEXCEPT(YourTableName, YourTableName[CIO], YourTableName[Resource])
    ),
    0
)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors