Forum Discussion

scoutmedic's avatar
scoutmedic
Helper I
2 years ago
Solved

Card displaying when categories exceed a calculated threshold

New to PBI here. I'm trying to create a card visual to display total number of categories exceeding a calculated threshold.

 

My organization currently uses multiple categories to classify errors and tracks based on a production value. I created two measures to account for the calculated error rate and calculated threshold value for each category. Currently, I'm using a bar graph and table to highlight when the error rate exceeds the threshold measure. However, I'd also like to have a card to display how many categories are exceeding the threshold. 

 

Current Measures:

     Error Rate

     Threshold

 

I thought this would be as simple as another measure to count when Error Rate > Threshold, but I'm unable to create such a measure. Thoughts on how this can be accomplished?

  • scoutmedic ,

    First, create a measure that evaluates whether the Error Rate exceeds the Threshold for each category. This measure will return 1 if the Error Rate exceeds the Threshold, and 0 otherwise.

     

    Exceeds Threshold = IF([Error Rate] > [Threshold], 1, 0)
    

    Next, create another measure to count how many categories have an Error Rate that exceeds the Threshold.

    Categories Exceeding Threshold = COUNTROWS(FILTER(ALL('YourTable'[Category]), [Exceeds Threshold] = 1))

     

2 Replies

  • Arul's avatar
    Arul
    Super User

    scoutmedic ,

    First, create a measure that evaluates whether the Error Rate exceeds the Threshold for each category. This measure will return 1 if the Error Rate exceeds the Threshold, and 0 otherwise.

     

    Exceeds Threshold = IF([Error Rate] > [Threshold], 1, 0)
    

    Next, create another measure to count how many categories have an Error Rate that exceeds the Threshold.

    Categories Exceeding Threshold = COUNTROWS(FILTER(ALL('YourTable'[Category]), [Exceeds Threshold] = 1))

     

    • scoutmedic's avatar
      scoutmedic
      Helper I

      Thanks Arul. Once I figured out to use brackets for measures, I was on the right track with the Exceeds Threshold measure. Just didn't create the Categories Exceeding Threshold measure. 

       

      Also, I added a +0 to the end of COUNTROWS expression to prevent it from returning BLANK if no rows met the criteria.