Forum Discussion
Column Graph for percentages, not counts
- 3 years ago
Ok, so I found a solution.
First, I went back to my query and realized that the total column was giving me "NaN" when the denominator was 0. To resolve this, I updated the formula for this column to
= if ([Yes]+[No]=0) then 0 else ([Yes]/([Yes]+[No]))
This resolved the NaN issue and gave me all numbers
Next, I changed the column type to Percentage
After reloading the queary, the visualization returned the expected results, despite indicating that it was still summing the values.
I did find one limitation. Because I have mulitiple locations for this data, I only get these "clean" results when I am filtered for a single location. If I try to combine the scores across locations, I get all of the locations added together. This makes sense, so I changed the function to Average and that resolved the problem. Reverting to a single location still returned the correct values for that individual location.
Ok, so I found a solution.
First, I went back to my query and realized that the total column was giving me "NaN" when the denominator was 0. To resolve this, I updated the formula for this column to
= if ([Yes]+[No]=0) then 0 else ([Yes]/([Yes]+[No]))
This resolved the NaN issue and gave me all numbers
Next, I changed the column type to Percentage
After reloading the queary, the visualization returned the expected results, despite indicating that it was still summing the values.
I did find one limitation. Because I have mulitiple locations for this data, I only get these "clean" results when I am filtered for a single location. If I try to combine the scores across locations, I get all of the locations added together. This makes sense, so I changed the function to Average and that resolved the problem. Reverting to a single location still returned the correct values for that individual location.