Forum Discussion
Sentiment Score - % of 'positive' responses
Hello looking for a DAX where I can see the % of Positive responses in my data. Note there are filters associated it with it as well. I have a current DAX that works, unless I apply a filter it doesn't take the % of positives within that amount. For Miami I should see 75 (6/8 are positive). See screen shot.
Your formula for the denominator is ignoring all filters with the ALL() function. If you want it to do ALL except for the location, you could replace the ALL with ALLEXCEPT('30 day new hire survey','30 day new hire survey'[location]), but that would still ignore slicers for W@H, Primary LOB, etc.
If you always want the percentage to take into account your slicer, you need to get rid of the ALL() entirely, and could then do away with CALCULATE and just use the COUNTROWS, which would change as your slicer changed.
3 Replies
- edhans
Community Champion
Your formula for the denominator is ignoring all filters with the ALL() function. If you want it to do ALL except for the location, you could replace the ALL with ALLEXCEPT('30 day new hire survey','30 day new hire survey'[location]), but that would still ignore slicers for W@H, Primary LOB, etc.
If you always want the percentage to take into account your slicer, you need to get rid of the ALL() entirely, and could then do away with CALCULATE and just use the COUNTROWS, which would change as your slicer changed.