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
ROG
Responsive Resident
Responsive Resident

Remove "_" and "+" and keep the conditional formatting.

Hello folks,

 

I have a condionatal formatting on my report, where if it's negative with the sign "-", it should be green otherqise red.

Negative means good.

I have been told to remove the signs from the values, but keep the colors, but my conditional formating is based on the negative sign.

What can I do 1st: to remove the sign from the values and then add a conditional formatting that give me the same colors?

 

ROG_0-1713776377042.png

 

ROG_1-1713776442478.png

Thanks!

1 ACCEPTED SOLUTION
johnbasha33
Impactful Individual
Impactful Individual

@ROG 

To achieve the desired outcome of removing the signs from the values while retaining the conditional formatting based on the absence of the negative sign, you can follow these steps:

1. **Remove Signs from Values**:
- In Power BI Desktop, create a new calculated column or measure (depending on where the values are stored) that removes the signs from the values.
- For example, if your original value is stored in a column named "Value", you can create a calculated column like this:
```
Abs_Value = ABS([Value])
```
- This will create a new column (or measure) that contains the absolute values of the original values, effectively removing the negative signs.

2. **Apply Conditional Formatting**:
- Now that you have the absolute values without signs, you can apply conditional formatting based on these values.
- Select the visual (e.g., table or matrix) where you want to apply the conditional formatting.
- Go to the "Format" pane for the visual.
- Find the formatting options for the column or measure where you've removed the signs (e.g., "Abs_Value").
- Apply conditional formatting based on the absolute values:
- Set the color green for values greater than or equal to zero (indicating good).
- Set the color red for values less than zero (indicating negative or bad).
- Save your changes.

By following these steps, you'll remove the signs from the values while still retaining the conditional formatting based on the absence of the negative sign. This way, you'll achieve the desired color representation (green for positive values, red for negative values) without relying on the presence of the negative sign.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

View solution in original post

3 REPLIES 3
v-yaningy-msft
Community Support
Community Support

Hi, @ROG 

You can refer to @johnbasha33 reply, if it does not work, you can refer to following method. If you have a similar data structure, you can write a Flag column and then regenerate the required Diff_2 %,with Flag as the background color of Measure

 

vyaningymsft_1-1713850771774.png

 

Best Regards,
Yang
Community Support Team

If this does not work, could you please share some sample data without sensitive information and expected output.

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum



johnbasha33
Impactful Individual
Impactful Individual

@ROG 

To achieve the desired outcome of removing the signs from the values while retaining the conditional formatting based on the absence of the negative sign, you can follow these steps:

1. **Remove Signs from Values**:
- In Power BI Desktop, create a new calculated column or measure (depending on where the values are stored) that removes the signs from the values.
- For example, if your original value is stored in a column named "Value", you can create a calculated column like this:
```
Abs_Value = ABS([Value])
```
- This will create a new column (or measure) that contains the absolute values of the original values, effectively removing the negative signs.

2. **Apply Conditional Formatting**:
- Now that you have the absolute values without signs, you can apply conditional formatting based on these values.
- Select the visual (e.g., table or matrix) where you want to apply the conditional formatting.
- Go to the "Format" pane for the visual.
- Find the formatting options for the column or measure where you've removed the signs (e.g., "Abs_Value").
- Apply conditional formatting based on the absolute values:
- Set the color green for values greater than or equal to zero (indicating good).
- Set the color red for values less than zero (indicating negative or bad).
- Save your changes.

By following these steps, you'll remove the signs from the values while still retaining the conditional formatting based on the absence of the negative sign. This way, you'll achieve the desired color representation (green for positive values, red for negative values) without relying on the presence of the negative sign.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

ROG
Responsive Resident
Responsive Resident

Many thanks @johnbasha33  for the detailed explanation. That works for me. 🙂

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.