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

How do I calculate the grand total in a matrix differently to the way the column is calculated

I have a matrix where I have 2 calculated measure columns:

Available Hours = sum('Dates'[Hours])-(sum('Reliability Data'[Planned Outage])+sum('Reliability Data'[Unplanned Outage]))
and
Availability = IFERROR((sum('Dates'[Hours])-sum('Reliability Data'[Planned Outage])-sum('Reliability Data'[Unplanned Outage]))/(sum('Dates'[Hours])),1) 
 
They produce a percentage or value of total time available of the total time once time outages are removed.
so the way the grand totals are calculated is done in exactly the same way, however it is meaningless and needs to be an average of the columns vlaues.
 
AlixB_0-1628758520182.png

 

How do I get the totals as an average rather than the same calculations as the rest of the column?

3 REPLIES 3
Mohammad_Refaei
Solution Specialist
Solution Specialist

Try this:

Availability =
VAR MyVar =
    IFERROR (
        (
            SUM ( 'Dates'[Hours] ) - SUM ( 'Reliability Data'[Planned Outage] )
                - SUM ( 'Reliability Data'[Unplanned Outage] )
        )
            / ( SUM ( 'Dates'[Hours] ) ),
        1
    )
RETURN
    IF (
        ISINSCOPE ( 'Reliability Data'[TAG] ),
        // [TAG] or any field you will use in your matrix
        MyVar,
        AVERAGEX ( 'Reliability Data', MyVar )
    )

Unfortunately that returns the same results as I currently have in both the column and the total

Then try this:

Availability =
VAR MyVar =
    IFERROR (
        (
            SUM ( 'Dates'[Hours] ) - SUM ( 'Reliability Data'[Planned Outage] )
                - SUM ( 'Reliability Data'[Unplanned Outage] )
        )
            / ( SUM ( 'Dates'[Hours] ) ),
        1
    )
RETURN
    IF (
        ISINSCOPE ( 'Reliability Data'[TAG] ),
        // [TAG] or any field you will use in your matrix
        MyVar,
        MyVar
            / COUNTROWS ( SUMMARIZE ( 'Reliability Data'[TAG], 'Reliability Data'[SYSTEM] ) )
    )

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.

Top Solution Authors
Top Kudoed Authors