Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply

I want to apply the color based on min and max values using measure

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.


Column1Column2Column3ColorKPI
Aa22Green
Aa24Orrange
Aa24.5Orrange
Aa36.7Orrange
Aa311.6Orrange
Aa323Red
Aa32Green
Aa43Orrange
Aa44.5Orrange
Bb211.6Orrange
Bb223Red
Bb32Green
Bb34.5Orrange
Bb46.7Orrange
Cc22Green
Cc24Orrange
Cc34.5Orrange
Cc46.7Red
Dd211.6Orrange
Dd26.7Orrange
Dd311.6Orrange
Dd423Red
Dd42Green
Ee23Green
Ee24.5Orrange
Ee311.6Red
Ee44.5Orrange
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@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!

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@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!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors