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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Font color with switch measure

Hey guys, I've got the following table that I got using Switch function. Now basically I want to do condition formatting for the last two rows(percentages) but only for them, that if they are above 0% then green otherwise red. The problem is, that I can only put formatting on two measures, which is the two colums that I got right now. So if I use it, the whole column goes green, but I only need to the last two rows. 
this is my switch function : 

Gediminas12_1-1605349784569.png

 

Gediminas12_0-1605349668802.png

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Try the following.

Create a conditional formatting measure along the lines of:

 

 

 

Conditional Format Values = 
IF(SELECTEDVALUE('Table'[Type]) IN {“2020 FAKTAS”, “2019 FAKTAS”, “2020 PLANAS”}, "black",
IF(AND(SELECTEDVALUE('Table'[Type]) IN {“POKYTIS NUO 2020 PLANO”}, [Pokytis nuo 2020 plano per mèn] >0), "Green",
IF(AND(SELECTEDVALUE('Table'[Type]) IN {“POKYTIS NUO 2019 FAKTO”}, [Pokytis nuo 2019 fakto per mèn] >0), "Green", "Red")))

 

 

 

 

The use this measure in the formatting pane under "Conditional Formatting", select the field and select the font colour option and use the [Conditional Format Values] measure (the yellow highlight should be the measure you are using in the visual):

CONDFOMAT.JPG





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Try the following.

Create a conditional formatting measure along the lines of:

 

 

 

Conditional Format Values = 
IF(SELECTEDVALUE('Table'[Type]) IN {“2020 FAKTAS”, “2019 FAKTAS”, “2020 PLANAS”}, "black",
IF(AND(SELECTEDVALUE('Table'[Type]) IN {“POKYTIS NUO 2020 PLANO”}, [Pokytis nuo 2020 plano per mèn] >0), "Green",
IF(AND(SELECTEDVALUE('Table'[Type]) IN {“POKYTIS NUO 2019 FAKTO”}, [Pokytis nuo 2019 fakto per mèn] >0), "Green", "Red")))

 

 

 

 

The use this measure in the formatting pane under "Conditional Formatting", select the field and select the font colour option and use the [Conditional Format Values] measure (the yellow highlight should be the measure you are using in the visual):

CONDFOMAT.JPG





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

@PaulDBrown  dude, you're lifesaver, thank you so much !!

VijayP
Super User
Super User

@Anonymous 

For conditional formatting you have to use separate switch function

Switch(true(),condition1,"Red",Condition2,"RGB(0,255,0)","Light Blue") and use the Field value option to take that on the field using conditional formatting! Hope this clarifies!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

@VijayP After putting it into the conditional formatting, it still colours the whole column: 

Gediminas12_0-1605354189251.png

 

@Anonymous  Share the formula you have used for conditional formatting

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

@VijayP  

conditional formatting = SWITCH(TRUE(), [Pokytis nuo 2019 fakto per mėn] < 0,"Red", [Pokytis nuo 2019 fakto per mėn] > 0,"RGB(0,255,0)","Light Blue")

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.