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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Conditional Formatting one cell based on another cell

dashboard.PNGHello all!

 

Each of the fields in the 'Metrics' column has a respective range for acceptable and unacceptable values (which will be reflected in the adjacent column labeled 'Grand Totals')

 

I would like to apply conditional formatting to each cell in Grand Total based on the range respective to the specific 'Metric' in question. 

 

For example: 5 'Assault' incidents may be considered high (that value in the 'Grand Total' column would be red). This same number of incidents may be considered a low figure for 'Detector Wandings' (that value would then be green). 

 

Any help or feedback is greatly appreciated! 🙂 

1 ACCEPTED SOLUTION

HI @Anonymous ,

Please take a look at following blogs to know more about switch functions:

DAX – Making the “Case” for SWITCH()

Optimizing IF and SWITCH expressions using variables

Please understand that these links are provided with no warranties or guarantees of content changes, and confers no rights.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

You can consider to write a measure with switch function to check current metric and return correspond color, then enable conditional formatting background color based on measure fields value.

Conditional formatting in tables

After these, you can enable conditional formatting on second field with 'rule' mode based on its value.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable


@v-shex-msft wrote:

Hi @Anonymous ,

You can consider to write a measure with switch function to check current metric and return correspond color, then enable conditional formatting background color based on measure fields value.

Conditional formatting in tables

After these, you can enable conditional formatting on second field with 'rule' mode based on its value.

Regards,

Xiaoxin Sheng


Thank you for your response 🙂 I am a total newbie (introduced to Power BI less than a month ago). Is there a tutorial available that you recommend explaining the execution of this Switch function? 

HI @Anonymous ,

Please take a look at following blogs to know more about switch functions:

DAX – Making the “Case” for SWITCH()

Optimizing IF and SWITCH expressions using variables

Please understand that these links are provided with no warranties or guarantees of content changes, and confers no rights.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.