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
sonam7
Microsoft Employee
Microsoft Employee

Issue with Conditional Formatting

Hi,

I am trying to do conditional formatting on Text Field but I see that there is no direct approach to do that. Hence, I have come across a work around to achieve the same. Please find below the DAX code I have written for the color coding:

 

StateNumber =
VAR StateValue = SELECTEDVALUE('MASCI vwEnvironments'[State])
RETURN
SWITCH(TRUE(),
StateValue = "In Progress", 1
)
Conditional Formatting1.PNG
 
Basically, I am trying to color-code based on State. However, the conditional formatting doesn't work fine.
As you can see below, it skips some of the values which are in State: "In Progress" . Also, sometimes it introduces duplicates of rows but that goes away when I refresh.
 
Please help with the same!
Conditional Formatting.PNG
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sonam7 

Check in the original dataset, if you have duplicates.

If there are duplicates, the formatting will not show.

You will have to get rid of the duplications. That can be achieved with adding a unique ID/Index to your visual, or deleting the duplicates in the import process.

 

Thanks!
A

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @sonam7 

Check in the original dataset, if you have duplicates.

If there are duplicates, the formatting will not show.

You will have to get rid of the duplications. That can be achieved with adding a unique ID/Index to your visual, or deleting the duplicates in the import process.

 

Thanks!
A

Anonymous
Not applicable

is it possible that in the rows that are being skipped over there is extra white space after "progress" like "In Progress "?

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.