Forum Discussion
True or False Percent Gauge
Hi All,
I am trying to convert the below table to a gauge.
What i would like to have the gauge show Cases solved that are TRUE as a percentage of the total number of CASE IDs.
Bit of a powerbi novice and struggling to get the percentage feature of the gauge to recognise the values.
Any help would be appreciated!
Thanks
| Case ID | Case Solved? |
| 1000 | TRUE |
| 1001 | FALSE |
| 1002 | TRUE |
| 1003 | TRUE |
| 1004 | TRUE |
| 1005 | FALSE |
| 1006 | FALSE |
| 1007 | TRUE |
| 1008 | TRUE |
| 1009 | TRUE |
| 1010 | TRUE |
- Anonymous9 years ago
Create 3 Measures. First measure would be a simple "CountRows" measure. That will give you the total number of cases. This measure will change depending on your filter context. Next create a 2nd measure which is going to count the number of True rows, this can be done doing something like:
CountTrue = CALCULATE( COUNTROWS('YourTable'), 'YourTable'[Case Solved?] = TRUE() )Lastly the 3rd measure is what is your percentage, which will be the [CountTrue] / [CountAll]
10 Replies
- AnonymousNot applicable
Create 3 Measures. First measure would be a simple "CountRows" measure. That will give you the total number of cases. This measure will change depending on your filter context. Next create a 2nd measure which is going to count the number of True rows, this can be done doing something like:
CountTrue = CALCULATE( COUNTROWS('YourTable'), 'YourTable'[Case Solved?] = TRUE() )Lastly the 3rd measure is what is your percentage, which will be the [CountTrue] / [CountAll]
- alecjbeckettFrequent Visitor
Thank you both.
Ross' was best for my data. Appreciate the help
- GuyloucouFrequent Visitor
I created the "CountRows" measure already. I calculated the difference between two dates and for each row has difference, the answer is a number. Can you tell me what I should do to know the percentage of the rows they are 0, dates are same?
Thanks
- AnonymousNot applicable
Hi Guyloucou, i'd love to help you but I can't for the life of me work out what you are asking. Your question didn't seem to make any sense.
- Dilesha08Frequent Visitor
How can we visualizre this?
- v-huizhn-msft
Microsoft Employee
Hi alecjbeckett,
>>Bit of a powerbi novice and struggling to get the percentage feature of the gauge to recognise the values.
It's still confusing, how to recognise the values? For gauge visual, there are min, max and target value, you want to the target shows the solved percentage? Please share more details for further analysis.
You can create the number of solved IDs and percentage using the following formula.Count True = CALCULATE(COUNTROWS(Table1),FILTER(Table1,Table1[Case Solved?]=TRUE()))
Percentage = CALCULATE(Table1[Count True]/CALCULATE(COUNTROWS(Table1),ALL(Table1)))You want to display your result as follows?
Best Regards,
Angelia