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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
TomBrilliant
Frequent Visitor

Conditional Formatting

Hi all,

 

I am trying to have confitional formatting on a table, when each customer number(Klantnr) has the same background colour. This helps me to have a quick overview what salesline belogs to the same order.


This is a preview of what I am looking for:

TomBrilliant_0-1678879384816.png

 

Can anyone help me out?

 

Thank you in advance!

 

Tom

 

4 REPLIES 4
TomBrilliant
Frequent Visitor

Thank you for the answers @AndrewPF @visheshjain 

Is it maybe possible to do something like this (made an example in Excel)? I can provide a color for number 1 to 30 with a color, since there will not be more than 30 customers max in the table. 

TomBrilliant_0-1678881196914.png

 

Hi @TomBrilliant,

 

Rather than numbers, my suggestion would be to use Hex Code for colors.
You can find them extremely easily with a Google search.

 

 

P.S. - Here is the link to conditionally format on string values as well, available since Feb 2023 update.

https://powerbi.microsoft.com/en-us/blog/power-bi-february-2023-feature-summary/#post-22137-_Toc1269...

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



visheshjain
Impactful Individual
Impactful Individual

Hi @TomBrilliant ,

 

You can define a dax measure where you can provide a color for every single customer number and then use it as conditional formatting.

The Feb 2023 update has the same thing simplified, where you can have conditional formatting based on text.

 

My suggested solution would be, assumming you have a lot of customers, is to have a table of all the customer numbers and a color associated with that number, which I think will be easier to create, than writing down all the customer numbers in a dax measure.

Then use this table in an IF() function with SELECTEDVALUE() to get the DAX measure for conditional formatting.

 

Hope this helps and if it does, then please do mark it as the best answer.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



AndrewPF
Helper V
Helper V

You can only format conditionally on a numeric value. 

If your customer numbers are finite and discrete, you could try creating a new column - customer ID, for example - where:

if [Klantnr] = "D10852" then [customer ID] = 1

else if [Klantnr] = "D11014" then [customer ID] = 2

etc..

then apply the conditional format using the new customer ID. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors