Forum Discussion

aflintdepm's avatar
aflintdepm
Icon for Helper III rankHelper III
3 years ago
Solved

Column Graph for percentages, not counts

I'm sure I'm missing something obvious, but I just can't figure it out.   My company wants to visualize scores on an audit.  The score is a percentage, just like a grade a test.  The score is calcu...
  • aflintdepm's avatar
    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.