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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Fusilier
Helper III
Helper III

Help with % measure

Hi,

I have a problem with this measure:

 

%fromAll SBCLGA = DIVIDE( SUM('Raw Data'[row count]),
CALCULATE(SUM('Raw Data'[row count]),
all('Raw Data'[Answers aggregated])))
 
The table below illustrates what is happening:
SectionQuestionAgreeDisagreeNeutralTotal Result
Our StrategyQuestion A26202369
Our StrategyQuestion B651369
Our StrategyQuestion C6911 80
Our StrategyQuestion D56 1369
 Total 32 287
      
 Answer being calculated by measure  '32/218 14.68%
 Answer should be:  '32/287 11.15%

 

The numbers are numbers of responses. Because there are no responses to Question D for response 'Disagree', when it calculates the total % it is ignoring the 69 in the Question D Total Result row.

Do I need to add in SUMX or similar to the measure? Can anybody help please?

2 ACCEPTED SOLUTIONS
Kaviraj11
Super User
Super User

Kaviraj11_0-1726073371680.png

I tried with a sample data and simple calculation. It's getting as expected

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @Fusilier ,
As Kaviraj11  said. You just need to create a simple dax expressions.

Disagree percentage = 
DIVIDE(
    SUM('Table'[Disagree]),
    CALCULATE(
    SUM('Table'[Agree])+SUM('Table'[Disagree])+SUM('Table'[Neutral]),
    ALL('Table')
    )
)

This will return the percentage of each row of data in the total data and provide the sum

vheqmsft_0-1726120588651.png

 

Best regards,
Albert He


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hi @Fusilier ,
As Kaviraj11  said. You just need to create a simple dax expressions.

Disagree percentage = 
DIVIDE(
    SUM('Table'[Disagree]),
    CALCULATE(
    SUM('Table'[Agree])+SUM('Table'[Disagree])+SUM('Table'[Neutral]),
    ALL('Table')
    )
)

This will return the percentage of each row of data in the total data and provide the sum

vheqmsft_0-1726120588651.png

 

Best regards,
Albert He


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Kaviraj11
Super User
Super User

Kaviraj11_0-1726073371680.png

I tried with a sample data and simple calculation. It's getting as expected

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you so much. All working fine now. Really appreciate your help with this.

Hi thank you for taking the time to help.

Excuse my ignorance.

Are you saying I should create three new tables? One each for:

Agree

Disagree

Neutral

 

Thanks

Kaviraj11
Super User
Super User

Yes, it's ignoring the blank, update the dax to include the condition of ISBLANK or adjust with your query 

 

%fromAll SBCLGA =
DIVIDE(
SUM('Raw Data'[row count]),
SUMX(
ALL('Raw Data'),
IF(ISBLANK('Raw Data'[row count]), 0, 'Raw Data'[row count])
),
0
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





AnkitKukreja
Super User
Super User

Hi! @Fusilier 

 

Your approach was correct but you can tweak the dax little bit. I have shared 2 sample dax below.

Div Test =
DIVIDE( SUM('Table'[Disagree]) , CALCULATE(SUM('Table'[Total Result]) ) )


Divide Test =
VAR _disagree = SUM('Table'[Disagree] )
VAR _total = SUM('Table'[Total Result])
VAR _division = DIVIDE( _disagree , _total , 0 )
RETURN
_division
 
For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Thank you for your reply. I think you're suggesting I create a table just for Disagree responses? I want to keep everything in the original table. My original measure was working apart for rows with null responses.

Hi! @Fusilier 

 

I just copy pasted the data from the table you shared in your post, can you paste the sample data if it doesn't look like this. My table looks like this:

AnkitKukreja_0-1726118663839.png

 

and I have written those 2 measures to get the answer.

Div Test =
DIVIDESUM('Table'[Disagree]) , CALCULATE(SUM('Table'[Total Result]) ) )


Divide Test =
VAR _disagree = SUM('Table'[Disagree] )
VAR _total = SUM('Table'[Total Result])
VAR _division = DIVIDE_disagree , _total , 0 )
RETURN
_division
 
AnkitKukreja_2-1726118821344.png

Please share the sample data or pbix file without any pii information if this doesn't work.

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904
Kaviraj11
Super User
Super User

Hi,

 

Can you try with the measure below:

 

%fromAll SBCLGA =
DIVIDE(
SUM('Raw Data'[row count]),
SUMX(
ALL('Raw Data'[Answers aggregated]),
'Raw Data'[row count]
)
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks for your help but it doesn't work. The measure won't accept 'row count' in the 

SUMX(
ALL('Raw Data'[Answers aggregated]),
'Raw Data'[row count]
)

 

Part of the measure.

'row count' is a calculated field here, so maybe that is the problem.

I've tried replacing that bit with a countrows measure, which works, but its still returning 14.68% instead of 11.15%.

Its still completely ignoring the Question D row total (69), I think because the Disagree response is nil.

My original measure works fine apart for rows with a null response 

Scratching my head over this.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Kudoed Authors