Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Remove Row Context from a hierarchy column in Matrix visualization

Hi All,   I am working on an use case wherein I am looking at multiple country data and analysing share values in a Matrix visualization. In rows of the matrix visualization I have hierarchy define...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Since you want to keep the selections of filtering, such as slicers. You can change your formula as

     

    Share =
    VAR Numerator =
        SUM ( 'TABLENAME'[SALES_VALUE] )
    VAR Denominator =
        CALCULATE (
            SUM ( 'TABLENAME'[SALES_VALUE] ),
            FILTER (
                ALLSELECTED ( TABLENAME ),
                TABLENAME['FILTER COL 1'] = MAX ( TABLENAME['FILTER COL 1'] )
                    && TABLENAME['FILTER COL 2'] = MAX ( TABLENAME['FILTER COL 2'] )
            )
        )
    RETURN
        DIVIDE ( Numerator, Denominator, 0 )
    

     

    ALLSELECTED function (DAX) - DAX | Microsoft Learn

    The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.

                                                                                                                                                                    

                                                                                                                                                             

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.