Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
HI,
I am trying to create a simple Employee table where I have yearly counts for male and female for last few years . I have created a measure to show percentages of male female by year as a measure . I am looking to format percentages as :
30% and below as red
31 % and above as Green
The problem is I want to achieve this conditional formating logic but want to apply it to female rows only (eg : based on the rule %2023parentrow column I want only 42% to show as green (since its greater than 30% ) and not 58% male as green). See attached table
Solved! Go to Solution.
You can write a measure to read the gender and return a formatting color for only F.
Format Female =
VAR _Gender = SELECTEDVALUE ( Table[Gender] ) = "F"
RETURN
IF ( _Gender, IF ( [Gender%] > .3, "Green", "Red" ) )
Formate the measure as text then apply it as conditional formatting to the % measure.
My sample data has Female/Male rather than F/M
Thank you so much ! This solved my problem 🙂
You can write a measure to read the gender and return a formatting color for only F.
Format Female =
VAR _Gender = SELECTEDVALUE ( Table[Gender] ) = "F"
RETURN
IF ( _Gender, IF ( [Gender%] > .3, "Green", "Red" ) )
Formate the measure as text then apply it as conditional formatting to the % measure.
My sample data has Female/Male rather than F/M
Excellent solution. Am I to understand that Power BI thus automatically interprets the strings "Red" and "Green" into their appropriate colors? Is there a list of what colors with which this can be done? Or any other similar tricks?
I hope it's appropriate to ask here.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
81 | |
67 | |
62 | |
46 | |
45 |