cancel
Showing results for
Did you mean:
Frequent Visitor

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

1 ACCEPTED SOLUTION
Anonymous
Not 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]

10 REPLIES 10
Microsoft

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

Anonymous
Not 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]

Regular Visitor

How can we visualizre this?

Frequent 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

Anonymous
Not 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.

Frequent Visitor

Sorry, my first language is French. Let me give you more details. I would like to write a measure to know how many projects are deliver to the target date anticipate. Can you help me?

Anonymous
Not applicable

Something like:

```CountTrue = CALCULATE(
COUNTROWS('YourTable'),
'YourTable'[Completed] = TRUE(),
'YourTable'[DeliveredDate] <= 'YourTable'[TargetDate]
)```
Frequent Visitor

Thank you Ross, I tried this and I received an error message:

CountTrue = CALCULATE(

COUNTROWS('My Table'),

'My table'[Total days delay design] = TRUE(),

'My table'[Design closing date] <= 'My table[Design requestdate]

The expression contains multiple columns, but only a single colomn can be used in a True/False expression that is used as a table filter expression.

In the column "Total days delay design" sometimes I have a number of days and sometimes nothing. Can you tell me what is wrong, please.

Anonymous
Not applicable

Looks like i've stuffed up and given you a bum steer.  Ok lets go another direction.  Create a new custom column with the formula:

```CountMe = IF(
'My table'[Design closing date] <= 'My table[Design requestdate],
1,
0
)```

Then use it within:

```CountTrue = CALCULATE(
COUNTROWS('My Table'),
'My table'[Total days delay design] = TRUE(),
'My table'[CountMe] = 1
)```

Frequent Visitor

Thank you both.

Ross' was best for my data. Appreciate the help

Announcements

Check it Out!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.