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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

gckcmc
Resolver I
Resolver I

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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