Forum Discussion

MKyger's avatar
MKyger
New Member
1 month ago
Solved

Hide column in chart instead of filtering?

I have a chart in Power BI that summarizes responses to multiple agreement statements. (If someone selected "Strongly agree" or "Somewhat agree" in the survey to one of the statements, that column % ...
  • Shai_Karmani's avatar
    1 month ago

    The reason your percentages change when you exclude "No" is that the visual's implicit percentage is calculated over the currently visible categories, so removing "No" also removes it from the denominator. The fix is to write an explicit measure whose denominator ignores the axis filter, then hide "No" at the visual level.

    Assuming your responses live in a table like Responses[Answer], and the axis of the chart is Responses[Answer]:

    % of Total =
    DIVIDE(
        CALCULATE ( COUNTROWS ( Responses ) ),
        CALCULATE ( COUNTROWS ( Responses ), ALL ( Responses[Answer] ) )
    )

    Use this measure as the value in the chart, then open the visual level filter for Responses[Answer] and uncheck "No". Because ALL(Responses[Answer]) releases the filter on Answer only for the denominator, the totals stay stable and Strongly Agree, Somewhat Agree etc. keep showing their true share of all respondents.

    If Answer sits on a dimension table instead of the fact table, use ALL on the dimension column and the same approach still works.

     

    If this helped, please give it a kudos and mark it as the accepted solution.

     

    Best,
    Shai Karmani

     

    Let's connect in LinkedIn