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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
SIH007_1
Frequent Visitor

Format default visual (bar chart)

Hi, I have a bar chart, at the moment the user can filter it using a slicer - just 3 different departments. I would like to give the bars different colors depending on the selected department and show all 3 states on one sheet (see screenshot). According to Microsoft, formatting is pretty simple, but I can't find the item Data colors at all. 

2022-05-31_16-47-36.pngx.png

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@SIH007_1 Step 1: First create a Measure like below  (As per your need) - If Proj ID is 1 so it will show Red and if 2 so it will show in Green.

 

Measure Color = SWITCH(TRUE(),
MAX('Proj Table'[Proj ID])=1, "Red",
MAX('Proj Table'[Proj ID])=2,"Green"
)
 
Step 2: Use this measure in Color funtion of bar chart:
3.JPG

 

 

Step 3: Then select Field option and use the Measure color:

Capture.JPG

 

Step 4: Final result based on Proj ID slicer.

1.JPG

 2.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

2 REPLIES 2
truptis
Community Champion
Community Champion

Hi @SIH007_1 ,

The data colors option for bar chart is present here in the new update of Power BI:

truptis_0-1654679712741.png

@SIH007_1 -> Please mark it as a solution and hit the thumbs up if it helps you. Thanks.

Tahreem24
Super User
Super User

@SIH007_1 Step 1: First create a Measure like below  (As per your need) - If Proj ID is 1 so it will show Red and if 2 so it will show in Green.

 

Measure Color = SWITCH(TRUE(),
MAX('Proj Table'[Proj ID])=1, "Red",
MAX('Proj Table'[Proj ID])=2,"Green"
)
 
Step 2: Use this measure in Color funtion of bar chart:
3.JPG

 

 

Step 3: Then select Field option and use the Measure color:

Capture.JPG

 

Step 4: Final result based on Proj ID slicer.

1.JPG

 2.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon โ€“ Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save โ‚ฌ200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.