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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
silja123
New Member

Measure counting total rows that is same fixed number for each category but changes when filtering

Hi all,

I have a problem that I can't figure out for some reason...

I have created table like this from my original multiple choise investigation data:

Multiple choice options          SumOfAnswers         CountOfAnswerers
A                                             10                             10
B                                              20                             20
C                                              50                             50
D                                              40                            40
Total                                        120                           50

SumOfAnswers is the sum of "yes" answers and answeres were able to answer "yes" to many options (not only one). So 50 people answered (Total od CountOfAswers) but they might have said yes to many options.

Now I want to create a measure seen in the table below (TOTALCountOfAnswers) BUT so that when I filter spesific group of answeres (for example women) the TOTALCountOfAnswerers changes from all 50 to 30 (number of women respondents): 

Multiple choice options          SumOfAnswers         CountOfAnswerers            TOTALCountOfAnswerers
A                                             10                             10                                        50
B                                              20                             20                                       50
C                                              50                             50                                       50
D                                              40                            40                                       50
Total                                        120                           50                                       50
                   
Because in the end I want to get the persentage of answers in relation to the respondent group (men/woman, age group etc.). So the divider should change based on the filter/respondent group but the TOTALCountOfAnswerers should not be divided between categories (A, B, C, D) as in CountOfAnwers. In the visual/diagram, however, the bars are formed by categories (A, B, C, D). The "All" function does not work as it then doesn't change the number based on my filtering. I have also tried "allexcept" funtion to exclude the "Multiple choice options" categories but that does not work either...

I would be super happy and grateful for help, thanks!


3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @silja123 ,

Pls test :

 

Calculate(Countrows(Table), ALLSELECTED(Table))

 

katika555
Resolver I
Resolver I

Calculate(Countrows(Table), All(Table))

It does not work becaused then  TOTALCountOfAnswerers is always 50 and doesn't change when I filter different respondent groups, as I explained...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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