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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MEtchart
New Member

Conditional formatting based on measure for a KPI visual

Situation: 

I have created a new Power BI report using an existing Power BI dataset.

I created a new measure in the new Power BI report to apply as conditional formatting on a KPI visual.

 

Problem:

Power BI does not allow me to select the new measure as Field Value for Conditional Formatting of the font color Callout value.

I don't get any error message, and the new measure seems to provide the correct output (checked by plotting values in a table).

 

The alternative is to create conditional formatting for the callout value as rules, but since it needs to be applied to many different visuals, a measure is way more efficient. 

 

Please help.

 

6 REPLIES 6
Anonymous
Not applicable

Hi @MEtchart ,

 

The conditional formatting is under "Format your visual". Click "fx" to set the conditional formatting.

vstephenmsft_0-1677722706360.png

 

   

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

Hi, thanks for this, but the problem goes beyond finding where the conditional formatting is. 

When trying to use it, it does not allow me to use a new meassure as field value. 

Anonymous
Not applicable

Hi @MEtchart ,

 

Choose "Field value" under Format style, select the measuer you want.

vstephenmsft_0-1679040995733.png

 

If you still have doubts, please provide some sample data and the desired results.

Or provide some screenshots to explain the problem. Take care to protect your privacy.

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

I don't know if picture will help, because I see the same thing as you do. It's just that the desired measure to be used is not listed in this overview. 

 

I believe that the problem is related to the creation of a new dashboard with a pre-existing Power BI data model. If the Measure is in the original data model, it works. But if I create the meassure in the new BI file, as an addition to the retrieved data model, then the meassure is not available for use for some reason. Needless to say I don't have control over the original BI Data Model to make the measure there. Otherwise I wouldn't have this problem.

Anonymous
Not applicable

Hi @MEtchart ,

 

vstephenmsft_0-1679368484967.png

I don't know if my understanding is wrong, are you saying that you don't have a measure in the slide bar above? If you don't create a measure in your data model, of course there won't be a measure, we created it ourselves.

For example

Measure = IF(SUM('Table'[Value])=100,"RED","GREEN")

vstephenmsft_1-1679368619034.png

 

About creating measures, refer to

Tutorial: Create your own measures in Power BI Desktop - Power BI | Microsoft Learn

 

There are a few considerations to keep in mind when working with conditional table formatting:

  • Any table that doesn't have a grouping is displayed as a single row that doesn't support conditional formatting.
  • You can't apply gradient formatting with automatic maximum/minimum values, or rule-based formatting with percentage rules, if your data contains NaN values. NaN means "Not a number," most commonly caused by a divide by zero error. You can use the DIVIDE() DAX function to avoid these errors.
  • Conditional formatting needs an aggregation or measure to be applied to the value. That's why you see 'First' or 'Last' in the Color by value example. If you're building your report against an Analysis Service multidimensional cube, you won't be able to use an attribute for conditional formatting unless the cube owner has built a measure that provides the value.

If you still have doubts, it's better to provide some screenshots of the issue. Remember to protect your privacy.

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

Let me see if I can exemplify with pictures.

 

this is the measure I want to use:

NPL on+off % color =
SWITCH(TRUE(),
    [NPL on+off %] < 0,04, "Green",
    [NPL on+off %] >= 0,04 && [NPL on+off %] < 0,05, "blue",
    [NPL on+off %] >= 0,05, "red",
    "")

 

and this is how the trend visual is made

 

MEtchart_1-1679388900752.png

 

 

And when I try to selec the 'Measure Table'[NPL on+off % color] measure as conditional formatting, click on it, the drop down list "What field should we base this on" remains blank:

MEtchart_2-1679389028913.png

 

As I mentioned, the 'Measure Table'[NPL on+off %]  is in the original Data Model, and the 'Measure Table'[NPL on+off % color] is created new after uploading the pre-existing Data Model.

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.