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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
LifeLongLearner
Frequent Visitor

Conditional formatting

Hello All! 
I have a measure 

Measure2 =
Var z = [Measure1]*0.5
Return
Switch(TRUE(),
z>1, 0 ,
z>=1.5 && z<=2.0, 2 ,
z>=2 && z<=3.0, 4 ,
z>=3.1&& z<=4.0,8 )

So, I want to add font color in the same measure. 

#community #ConditionalFormatting 

3 REPLIES 3
amitchandak
Super User
Super User

@LifeLongLearner , One way is to have a similar color measure and use that in conditional formatting using "Field value option"

Or use rules

 

Measure2 color =
Var z = [Measure1]*0.5
Return
Switch(TRUE(),
z>1, 0 ,
z>=1.5 && z<=2.0, "Red" ,
z>=2 && z<=3.0, "Green",
z>=3.1&& z<=4.0, "Blue" )

 

refer for steps

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amit chandak 
Thank you for the response but I am looking for a different result. Actually, the range that I have fixed in the measure should remain the same as for example z>=2 && z<=3.0, 4 I want to give a particular value to this expression as 4. Also, I want to write the color name in the same measure so that At the end I can change it directly. I don't want to Format it by Color Scale and Rules.

z>=2 && z<=3.0, 4 ,"Green",   [This is incorrect but looking for similar one in right format]

Something like this ....where I can put all the three values together in the same measure.
Looking for the response.

Anonymous
Not applicable

Hi @LifeLongLearner ,

I'm confused about the following sentences... Do you want to create a measure to set the particular value (0, 2, 4 and 8)and format the font color (red, green and blue etc.) base on different conditions at the same time? Three values means? Could you please provide your desired result with the format of table or screenshots? And please provide more details on it. Thank you.

z>=2 && z<=3.0, 4 ,"Green",   [This is incorrect but looking for similar one in right format]

Something like this ....where I can put all the three values together in the same measure.


Best Regards

Rena

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.