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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Help with calculating percentages based on total distinct count at row level

Hopefully someone can help - I am trying to calculate some percentages of anwers from some survey data.

 

The data is unpivoted and I wish to show the perctantage for each bullying behaviour.  I am able to do this when I use the distinct respondent count and then adjust the column to show as a percentage of grand total (highlighted in yellow), however when i attempt to write dax to achieve the same thing, it is giving me the percentage based on the totals at row level, not the overall total of 111.

 

This is the dax  measure I am using - 

% Bullying = DIVIDE([Respondent Distinct Count],CALCULATE([Countrows](Bullying)))
(The reason I need to write a dax measure is that i then need to calculate differences compared to a previous data set)
 
Help 🙂
 
Dax question.JPG
 

 

 

2 ACCEPTED SOLUTIONS

Hi, @Anonymous 

 

try below

result =
DIVIDE(
    [Respondent Distinct Count],
    CALCULATE(
        [Respondent Distinct Count], 
       removefilters('tablename'[bullying behaviour])
    )
)

View solution in original post

aha, try like:

try like:

% Bullying = 
DIVIDE(
    [Respondent Distinct Count],
    CALCULATE(
         [Respondent Distinct Count],
        ALL(Bullying)
    )
)

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Thanks for your help, adding in the remove filters to the DAX did the trick! 🙂

FreemanZ
Super User
Super User

hi @Anonymous ,

 

try like:

% Bullying = 
DIVIDE(
    [Respondent Distinct Count],
    CALCULATE(
        Countrows(Bullying), 
        ALL(Bullying)
    )
)

Anonymous
Not applicable

Hi @FreemanZ 

 

Thank you for your suggestion - unfortunately its still not givng me the answer - its dividing by 341, which is the number of rows, not the distinct respondent count (111) - see below

Dax Answer.JPG

aha, try like:

try like:

% Bullying = 
DIVIDE(
    [Respondent Distinct Count],
    CALCULATE(
         [Respondent Distinct Count],
        ALL(Bullying)
    )
)

Hi, @Anonymous 

 

try below

result =
DIVIDE(
    [Respondent Distinct Count],
    CALCULATE(
        [Respondent Distinct Count], 
       removefilters('tablename'[bullying behaviour])
    )
)

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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