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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
TonyGoose_001
New Member

Divide measure that excludes values without Calculate

Hi

 

I wish to amend the following query to exlcude "No" from the numerator as well as the demoninator. However if I use CALCULATE to try and achieve this it loses the context and sets all values to 1 (or 100%) within my matrix. How do I exclude "No" from the numerator?

 
% of Responses = 
IF(
ISINSCOPE(Survey[Responses]),
DIVIDE(
COUNTA(Survey[Responses]),
CALCULATE(
COUNTA(Survey[Responses]),
Survey[Responses] <> "No",
REMOVEFILTERS(Survey[Responses])
)
)
)
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @TonyGoose_001 

You can try this measure to achieve your need.

vyaningymsft_0-1722495235742.png
Measure:

% Responses = 
VAR _countOfResponses =
    CALCULATE (
        COUNT ( 'Table'[Responses] ),
        FILTER ( 'Table', 'Table'[Responses] <> "BLANK" )
    )
VAR _allCountsOfResponses =
    CALCULATE ( COUNT ( 'Table'[Responses] ), 'Table'[Responses] <> "BLANK" )
VAR _result =
    IF (
        NOT ISBLANK ( _countOfResponses ),
        DIVIDE ( _countOfResponses, _allCountsOfResponses )
    )
RETURN
    _result

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi, @TonyGoose_001 

You can try the following measure.

% of Responses = 
IF(
    ISINSCOPE(Survey[Responses]),
    DIVIDE(
        COUNTA(FILTER(Survey, Survey[Responses] <> "No")),
        COUNTA(FILTER(ALL(Survey), Survey[Responses] <> "No))
    )
)

 

If this does not work, could you please share some sample data without sensitive information and expected output.

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

Hi v-yaningy-msft

 

Thanks for your response. Sadly that didn't work. It states that counta will only accept a column reference as an argument. However I have done as you have suggested, below is some made up sample data to illustrate the problem (i hope I've done that correctly).

Also, here's a picture of the aspect I would like to change with an example highlighted. I want to retain the count of BLANKS but remove them from the percentages. For the highlighted example the answer would read:

Telephone 80%

Face to Face 20%

 

TonyGoose_001_1-1721753946050.png

Reply IDSurvey DateQuestionsResponses
161423-Apr-241. How was the data collected?1 Telephone
161423-Apr-242. How satisfied or dissatisfied are you with the service provided?1 Very satisfied
161423-Apr-243. Has work been carried out to your home in the last 12 months?1 Yes
77001-Apr-241. How was the data collected?1 Telephone
77001-Apr-242. How satisfied or dissatisfied are you with the service provided?2 Fairly satisfied
77001-Apr-243. Has work been carried out to your home in the last 12 months?1 Yes
40401-Apr-241. How was the data collected?BLANK
40401-Apr-242. How satisfied or dissatisfied are you with the service provided?2 Fairly satisfied
40401-Apr-243. Has work been carried out to your home in the last 12 months?1 Yes
211217-Apr-241. How was the data collected?3 Face to Face
211217-Apr-242. How satisfied or dissatisfied are you with the service provided?1 Very satisfied
211217-Apr-243. Has work been carried out to your home in the last 12 months?1 Yes
538023-Apr-241. How was the data collected?1 Telephone
538023-Apr-242. How satisfied or dissatisfied are you with the service provided?1 Very satisfied
538023-Apr-243. Has work been carried out to your home in the last 12 months?2 No
163023-Apr-241. How was the data collected?1 Telephone
163023-Apr-242. How satisfied or dissatisfied are you with the service provided?1 Very satisfied
163023-Apr-243. Has work been carried out to your home in the last 12 months?1 Yes

 

Anonymous
Not applicable

Hi, @TonyGoose_001 

You can try this measure to achieve your need.

vyaningymsft_0-1722495235742.png
Measure:

% Responses = 
VAR _countOfResponses =
    CALCULATE (
        COUNT ( 'Table'[Responses] ),
        FILTER ( 'Table', 'Table'[Responses] <> "BLANK" )
    )
VAR _allCountsOfResponses =
    CALCULATE ( COUNT ( 'Table'[Responses] ), 'Table'[Responses] <> "BLANK" )
VAR _result =
    IF (
        NOT ISBLANK ( _countOfResponses ),
        DIVIDE ( _countOfResponses, _allCountsOfResponses )
    )
RETURN
    _result

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Amazing, thank you.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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