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.
- Arul3 years ago
Super User
try this measure,
Score% = DIVIDE(MAX('Yes/No'[Yes]),SUMX('Yes/No','Yes/No'[Yes]+'Yes/No'[No]))Thanks,
- Thennarasu_R3 years ago
Responsive Resident
Hi Anna,
Here you using max .It consider only Maximum Value in Column or Consider sum of Total value 😊😍- Arul3 years ago
Super User
For the above, we need max of that particular context if it is having one row like the above (For eg: A is having one row and we are considering MAX of that context) and summing up two column values of that row for both yes and no, so it will work in this scenario.
Thanks,