Forum Discussion
Help with % measure
- 2 years ago
I tried with a sample data and simple calculation. It's getting as expected
- Anonymous2 years ago
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
Best regards,
Albert HeIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi! Fusilier
Your approach was correct but you can tweak the dax little bit. I have shared 2 sample dax below.
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.
- AnkitKukreja2 years ago
Super User
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:
and I have written those 2 measures to get the answer.
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_divisionPlease share the sample data or pbix file without any pii information if this doesn't work.