Forum Discussion

alecjbeckett's avatar
alecjbeckett
Frequent Visitor
9 years ago
Solved

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 IDCase Solved?
1000TRUE
1001FALSE
1002TRUE
1003TRUE
1004TRUE
1005FALSE
1006FALSE
1007TRUE
1008TRUE
1009TRUE
1010TRUE

 

  • Anonymous's avatar
    Anonymous
    9 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

  • Anonymous's avatar
    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]

     

    • alecjbeckett's avatar
      alecjbeckett
      Frequent Visitor

      Thank you both.

       

      Ross' was best for my data. Appreciate the help

    • Guyloucou's avatar
      Guyloucou
      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's avatar
        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.

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Icon for Microsoft Employee rankMicrosoft 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