Forum Discussion

sneidercub's avatar
sneidercub
Frequent Visitor
4 years ago
Solved

Array to display the total category group

Hello Community, So I have this database with about 2 million rows structured like that. So what I want to do is show them in a matrix like this. I was trying to add the word...
  • danextian's avatar
    danextian
    4 years ago

    Hi sneidercub ,

    I've updated the Sum with Total measure to:

     

    Sum with Total = 
    VAR __One =
        SELECTEDVALUE ( Category[Category] )
    RETURN
        IF (
            __One = "Total"
                || NOT ( HASONEVALUE ( Category[Category] ) ),
            CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table'[Category] ) ),
            CALCULATE (
                SUM ( 'Table'[Value] ),
                FILTER ( 'Table', 'Table'[Category] = __One )
            )
        )

     

     

    The rest involves formatting the matrix visual. However, selectively removing the subtotal for each item in a column is not currently supported.

    You may refer to the same link for the updated pbix.