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
dd88
Resolver I
Resolver I

Conditional formatting on Age >17.75

In an Excel spreadsheet, columns exist for
Date of birth
Age
Column Age stores the persons age and contains a formula with Conditional Formatting
If Age value >17.75 highlight in colour Red.


In powerbi, the data source is the spreadsheet.
Date of birth column is formatted as Date Short
Age column is formatted as Decimal number, 2 decimal places.

 

The report has a table that displays columns Date of birth and Age.

I select the Age field to apply Conditional formatting on Background.
If create a Rule, it only displays value between AND value
eg if value >= 'value' AND <'value'

 

I have selected the different drop downs options however it does not allow the rule based on 1 value. It always 'forces' 2 values between and I cannot get further.

 

If the field is Text format. The Rules display only 1 value to test.
However if the field is a number format, The rules display 2 values range that must be entered.

 

AgeConditionalFormatting.png

 

All I want is a simple condition if  Age value >17.75 highlight in colour Red.

How can this be done.

1 ACCEPTED SOLUTION

Thank you @v-yaningy-msft 

 

Now resolved, I used the following condition to get it working ..


If value => 17.5 number and <=100 number then Red

 

The condition is,

if Age is greater than or equal to 17.5 and less than or equal to 100 (years age), then Red.

 

2024-04-16 08_54_20-Foster Care database.png

 

 

View solution in original post

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

Hi, @dd88 

You can refer to @HarishKM reply. IF it does not work, you can try following method.

Method 1 :

vyaningymsft_3-1713165810325.png


Change the portion of the box to 100 Percent.

vyaningymsft_1-1713165515942.png

 

Method 2:
Use Measure

vyaningymsft_4-1713165869492.png

 

Measure:

 

Age2Color = IF(SELECTEDVALUE('Table'[Age2])>=17.75,"Red")

 

Effect:

vyaningymsft_5-1713166011394.png


Best Regards,
Yang
Community Support Team

 

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





Thank you @v-yaningy-msft 

 

Now resolved, I used the following condition to get it working ..


If value => 17.5 number and <=100 number then Red

 

The condition is,

if Age is greater than or equal to 17.5 and less than or equal to 100 (years age), then Red.

 

2024-04-16 08_54_20-Foster Care database.png

 

 

HarishKM
Impactful Individual
Impactful Individual

@dd88 Hello
You need to use Varriance of age to get the conditional formating.

 

HarishKM_2-1712901289644.png

 

 

Thanks
Harish Mishra

If I solve this issue Kindly give kudos and accept this solution.

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.