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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Saxon10
Post Prodigy
Post Prodigy

Conditional formatting based on the Text

 

I have two tables are data and report.

 

In data table contain item, country code and Fruit Name. (All of them stored as a text format)

 

In report table contain country code only.

 

I would like to apply the conditional formatting for country code based on the fruit name. (Please refer the condition/ Rule of color code each fruits Name.

 

In Excel we apply the conditional formatting in one goal (Select the from to cell and apply the CF) but how can I apply the conditional formatting in one goal.

 

Can you please advise.

 

DATA TABLE

Item

Country Code

Fruits Name

123

IND01

Apple

124

IND01

Apple

125

IND01

Apple

126

IND01

Apple

127

UK01

Banana

128

UK01

Banana

129

UK01

Banana

130

UK01

Banana

131

US01

lemon

132

US01

lemon

133

US01

lemon

134

US01

lemon

135

US01

lemon

136

US01

lemon

137

US01

lemon

138

SRI1

lime1

139

SRI2

lime2

140

SRI3

lime3

141

SRI4

lime4

142

SRI5

lime5

 

 

REPORT TABLE

IND01

UK01

US01

 

 

 

 

 

 

      

 

 

 

 

SRI1

SRI2

SRI3

SRI4

SRI5

 

DATA & REPORT & RULE:

 

 

Saxon10_1-1620336295980.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Saxon10 , You can create a color measure like the below one and use it in conditional formatting using "Field value" option

 

Switch(True(),
max(Table[fruit name]) ="APPLE" , "green" , // or use hexcode with #
max(Table[fruit name]) ="banana" , "orange" ,
max(Table[fruit name]) ="Lemon" , "yellow"
)

 

 

Refer: How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Saxon10 , You can create a color measure like the below one and use it in conditional formatting using "Field value" option

 

Switch(True(),
max(Table[fruit name]) ="APPLE" , "green" , // or use hexcode with #
max(Table[fruit name]) ="banana" , "orange" ,
max(Table[fruit name]) ="Lemon" , "yellow"
)

 

 

Refer: How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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