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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PrashantA
Helper I
Helper I

How apply conditional formatting using multiple columns in PBI Desktop - Help required

Team,

 

I have below scenario where have data of various customers (Branches, Store, Market type and Month wise business) of approx 400 excel files.

 

Help required: how to apply conditional formating using combination of Customer+Branch+Store ID to highlight in which month the market type was changed from Rural to Urban and back to Rural.

 

E.g. Customer A (A1 branch) has the scenario where in Jul month Market type was "Rural" and in Aug it became Urban and then in Sep again Rural.

 

Please guide

 

Thanks and Regards,

Prashant

 

Sample table:

PrashantA_0-1623793766971.png

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @PrashantA 

According to your description and sample data, I can roughly understand your requirement, I think you can use the “Conditional formatting” function in the Power BI matrix to achieve this, you can try my steps:

  1. Go to the Power Query and do some operations as below pictures:

Unpivot columns:

vrobertqmsft_0-1624010391186.png

 

Then rename the column:

vrobertqmsft_1-1624010391190.png

 

  1. Click on the “Apply and close” and create a matrix and place it like this:

vrobertqmsft_2-1624010391195.png

 

  1. Create a measure:
Color =

IF(MAX('Table'[Market])="Urban","Green","Yellow")
  1. Go to the “Format” pane and set it like this:

vrobertqmsft_3-1624010391196.png

vrobertqmsft_4-1624010391196.png

 

And you can get what you want, like this:

vrobertqmsft_5-1624010391197.png

When the Market type is "Urban", it displays green color and displays yellow color if it’s “Rural”.

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @PrashantA 

According to your description and sample data, I can roughly understand your requirement, I think you can use the “Conditional formatting” function in the Power BI matrix to achieve this, you can try my steps:

  1. Go to the Power Query and do some operations as below pictures:

Unpivot columns:

vrobertqmsft_0-1624010391186.png

 

Then rename the column:

vrobertqmsft_1-1624010391190.png

 

  1. Click on the “Apply and close” and create a matrix and place it like this:

vrobertqmsft_2-1624010391195.png

 

  1. Create a measure:
Color =

IF(MAX('Table'[Market])="Urban","Green","Yellow")
  1. Go to the “Format” pane and set it like this:

vrobertqmsft_3-1624010391196.png

vrobertqmsft_4-1624010391196.png

 

And you can get what you want, like this:

vrobertqmsft_5-1624010391197.png

When the Market type is "Urban", it displays green color and displays yellow color if it’s “Rural”.

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

I am not sure of how much i can help but i'd like to try.  Share the link from where i can download your PBI file.  Also, share the source Excel file (from where you imported data into the PBI file).


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

Sorry but unable to share it with you as first of all its big data 45gb and restricted one. Hence shared with you the sample table.

 

Hope this helps.

 

Thanks and Regards,

Prashant

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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