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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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