Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to apply the color based on the column values using measure with min and max with respect to values which are in another column. How can we chiev this?
Suppose we have a table as shown below and I want to create a measure like ColorKPI which calculate colors based on the value from Column3 with respect to value from Column1.
Column1 | Column2 | Column3 | ColorKPI |
A | a2 | 2 | Green |
A | a2 | 4 | Orrange |
A | a2 | 4.5 | Orrange |
A | a3 | 6.7 | Orrange |
A | a3 | 11.6 | Orrange |
A | a3 | 23 | Red |
A | a3 | 2 | Green |
A | a4 | 3 | Orrange |
A | a4 | 4.5 | Orrange |
B | b2 | 11.6 | Orrange |
B | b2 | 23 | Red |
B | b3 | 2 | Green |
B | b3 | 4.5 | Orrange |
B | b4 | 6.7 | Orrange |
C | c2 | 2 | Green |
C | c2 | 4 | Orrange |
C | c3 | 4.5 | Orrange |
C | c4 | 6.7 | Red |
D | d2 | 11.6 | Orrange |
D | d2 | 6.7 | Orrange |
D | d3 | 11.6 | Orrange |
D | d4 | 23 | Red |
D | d4 | 2 | Green |
E | e2 | 3 | Green |
E | e2 | 4.5 | Orrange |
E | e3 | 11.6 | Red |
E | e4 | 4.5 | Orrange |
Solved! Go to Solution.
@RameshPachunuri Please create following measure
and then right click on column on which you want color formatting >> click on conditional formatting >> font color
In format by drop down select field value
In based on field select this measure.
Measure =
VAR _max = CALCULATE(MAX('Table'[Column3]),ALLEXCEPT('Table','Table'[Column1]))
VAR _min = CALCULATE(MIN('Table'[Column3]),ALLEXCEPT('Table','Table'[Column1]))
RETURN SWITCH(TRUE()
,MAX('Table'[Column3])=_max,"#cc351b"
,MIN('Table'[Column3])=_min,"#42f551"
,"#dde01b")
Hit kudos button and mark it as a solution if it helps you!
@RameshPachunuri Please create following measure
and then right click on column on which you want color formatting >> click on conditional formatting >> font color
In format by drop down select field value
In based on field select this measure.
Measure =
VAR _max = CALCULATE(MAX('Table'[Column3]),ALLEXCEPT('Table','Table'[Column1]))
VAR _min = CALCULATE(MIN('Table'[Column3]),ALLEXCEPT('Table','Table'[Column1]))
RETURN SWITCH(TRUE()
,MAX('Table'[Column3])=_max,"#cc351b"
,MIN('Table'[Column3])=_min,"#42f551"
,"#dde01b")
Hit kudos button and mark it as a solution if it helps you!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |