Problem with setting the rule in conditional formatting - colours

Hi,

Could I please for help regarding my problem.

I have a problem with the second and third rule rule where I have to show amber for values between “-1%” to “0%” . Everything above should be green and everything below should be red. I am unable to upload my PBI file because my data is super confidential.

Many thanks for your help,

Iwona

Hi @Iwona,
As I can see in the image, the definition of the third rule includes the values of the second. You can modify rules like:

Rule 1: >= 0 Percent <= 100 Percent
Rule 2: >= -1 Percent < 0 Percent
Rule 3: >= -10 Percent < -1 Percent

Regards,

It does not work :frowning:

I can see that negative % are not accepted here and need to find solution to make it work. “0” belongs to amber .

Iwona

Hi @Iwona. The last number in the 2nd and 3rd rows are both zero; as mentioned above, try setting the last number in the 3rd row to -1.
Greg

1 Like

Hello @Iwona,

Thank You for posting your query onto the Forum.

You can write the logic as provided below -

Since Power BI doesn’t accepts “Negative Percentages” as a logic. We need to specify them in the form of Numbers i.e., for “0%” will be written as “0.00” whereas for “100%” will be written as “1”. In case of decimals, i.e., from “-10%” to “-1%”, it’ll be written as “-0.1” to “-0.01” (Refer 3rd condition line).

I’m also attaching the working of the PBIX file for the reference purposes.

Hoping you find this useful and meets your requirements that you’ve been looking for. :slightly_smiling_face:

Thanks and Warm Regards,
Harsh

Conditional Formatting - Harsh.pbix (702.9 KB)

3 Likes

@Harsh

Many many thanks to you for your help,
your solution makes my report correct.

Regards,

Iwona

1 Like

Hello @Iwona,

You’re Welcome!! :slightly_smiling_face:

I’m glad that I was able to assist you.

Thanks and Warm Regards,
Harsh