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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.