Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to replace value in a matrix without affecting total row

Hi all,    I have data and created a summary matrix of vaccinated and registered pets by pet type. I created a measure % Registered Pets Vaccinated to replace the values of Pet Type= Unknown to --....
  • PaulDBrown's avatar
    3 years ago

    Try:

    % Registered Pets vaccinated =
    VAR _Vacc =
        DIVIDE (
            SUM ( 'Table'[Number Vaccinated] ),
            SUM ( 'Table'[Number of Registered Pets] )
        )
    RETURN
        IF ( SELECTEDVALUE ( 'Table'[Pet Type] ) = "Unknown", BLANK (), _Vacc )