Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Apsawhney
Helper I
Helper I

Status Card

Hi All,

 

I am creating a Health Check report on Power BI. I have various sections and each section has different guidelines and thresholds to be classified as "Healthy" or "Unhealthy". Now I am creating some custom measures in each section which gives a value of 0 or 1 based on the threshold being breached. Based on that I am highlighting the cells using conditional formatting to red/green.

 

I am looking to create a measure that shows the overall status of a section. Now I have used conditional formatting to highlight a cell in red if it breaches threshold but I wanted a measure which should show the overall status as well.

 

For e.g. In below image if you see one cell is red cause because the threshold is breached, so I want a overall status card to show as “Unhealthy” if any cell is red.

 
 
 

image.png

 

Please note I had posted the exact same problem in below post. But unfortunatelyI had to switch from import to direct query mode and somehow now that measure is not working. 

https://community.powerbi.com/t5/Desktop/Health-Status-Card/m-p/831981#M399619

1 ACCEPTED SOLUTION
kentyler
Solution Sage
Solution Sage

I built a dummy table and loaded it. Then I added a calculated column to tell if each line had breached the threshold
assessment_calculated_column.png

Then I wrote a measure to count all the 1's

assessment_measure2.png

I used 2 different tactics. One was to use a calculated column, because i needed access to a row context to easily calculated whether a row had exceeded or not.

The other was to use a measure, because i needed to use Calculate and All to reset the filter context so my count would count all the rows in the table, regardless of whether or not a user had clicked on one of the rows in the interface.

 




Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


View solution in original post

4 REPLIES 4
kentyler
Solution Sage
Solution Sage

I built a dummy table and loaded it. Then I added a calculated column to tell if each line had breached the threshold
assessment_calculated_column.png

Then I wrote a measure to count all the 1's

assessment_measure2.png

I used 2 different tactics. One was to use a calculated column, because i needed access to a row context to easily calculated whether a row had exceeded or not.

The other was to use a measure, because i needed to use Calculate and All to reset the filter context so my count would count all the rows in the table, regardless of whether or not a user had clicked on one of the rows in the interface.

 




Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Hi,

 

So I was have 2 tables - Assessments (Direct Query) and Threshold (Custom created hence import). So I was not able to create your columns in the Assessment table but was able to use them in Threshold table. 

 

Breach = IF(Threshold>Calculate(SUM(Assessment(Assessment Count)),1,0)

 

Status = IF(MAX(Breach)>0,1,0)

 

I actaully had the same formula as "Breach" formula above but instead of column I had used measure. So the measure might have caused the status to have measure to have incocorect value. 

Hi @kentyler ,

 

I forgot to mention, the threshold values are actually getting picked from a diffrent table. So the measure is like - 

 

IF(Assessments(latest assessment)<Threshold(Threshold),0,1).

 

So I am unable to create this calculated column. 

kentyler
Solution Sage
Solution Sage

I built a dummy table and loaded it. Then I added a calculated column to tell if each line had breached the threshold

 




Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.