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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
WorkHard
Helper V
Helper V

What is a good trick to show the "Blank" value as green in the KPI

I have a KPI that has a target.

The colors desired are as follows:

1. If it's above 80%, it's green.

2. If it's below 80% is red.

3. If there's no data for the month and it displays "Blank" I'd like that as either green or grey.

 

I have issues with point 3. I can't find a way to turn this "Blank" into another color.

Any ideas?

WorkHard_0-1612302035036.png

I tried to modify the Bad Value color with a function but it still shows in red.

WorkHard_0-1612303034319.png

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @WorkHard 

According to your description and sample picture, you want to set the KPI card to grey if the value is blank and you can not find the option. I think you achieve this using “Field value” in the conditional format, can follow my steps:

  1. Create a measure:

 

Color =

var _percent=

DIVIDE(MAX('Table'[Amount]),MAX('Table'[Goal]))

return

SWITCH(

    TRUE(),

    MAX('Table'[Amount])=BLANK(),"Grey",

    _percent>0.8,"Green",

    _percent<=0.8,"Red"

)

 

  1. Go to the “Color coding and set like this”:

v-robertq-msft_0-1612511121438.png

 

v-robertq-msft_1-1612511121440.png

 

  1. And you can get what you want, like this:

v-robertq-msft_2-1612511121464.png

 

v-robertq-msft_3-1612511121483.png

 

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-robertq-msft
Community Support
Community Support

Hi, @WorkHard 

According to your description and sample picture, you want to set the KPI card to grey if the value is blank and you can not find the option. I think you achieve this using “Field value” in the conditional format, can follow my steps:

  1. Create a measure:

 

Color =

var _percent=

DIVIDE(MAX('Table'[Amount]),MAX('Table'[Goal]))

return

SWITCH(

    TRUE(),

    MAX('Table'[Amount])=BLANK(),"Grey",

    _percent>0.8,"Green",

    _percent<=0.8,"Red"

)

 

  1. Go to the “Color coding and set like this”:

v-robertq-msft_0-1612511121438.png

 

v-robertq-msft_1-1612511121440.png

 

  1. And you can get what you want, like this:

v-robertq-msft_2-1612511121464.png

 

v-robertq-msft_3-1612511121483.png

 

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

GReyes85
Frequent Visitor

I would also recommend for you to set the rule to be "less than or equal to" and try adding to your measure AVG a "+0" in the end to avoid showing the Blank! message 

 

I actually prefer to show "Blank" when there are no results vs 0% which might be confused as a real 0%.

lkalawski
Memorable Member
Memorable Member

Hi @WorkHard ,

You can do this by using min and max in the conditional formatting:

lkalawski_0-1612304698076.png

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

Hm, there's no "Conditional formatting" option for the KPI card. Only "Color Coding" which I tried as explained in OP.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.