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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ayeoh
Employee
Employee

Conditional Formatting of Multiple Text Fields

Hello,

I have a table with 7 columns where each column's value is either "True" or "False".

I created a table visual where the 7 columns' values are populated inside this table, so the table has 7 columns and multiple rows, and each row has 7 values that are either "True" or "False".

I would like to conditionally format each "True" value in GREEN font ("False" can stay in default Black color).

How do I do that?

Thank you.

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @ayeoh 
You can create a flag measure for every column using Dax :

condition2 = if (SELECTEDVALUE('Table'[column2])=TRUE(),1,0)
Ritaf1983_0-1693419269282.png

And then use for every column conditional formatting this measure (one by one specific flag for specific column)

Ritaf1983_1-1693419329259.png

Link to a sample file : Here 

 

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

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @ayeoh 
You can create a flag measure for every column using Dax :

condition2 = if (SELECTEDVALUE('Table'[column2])=TRUE(),1,0)
Ritaf1983_0-1693419269282.png

And then use for every column conditional formatting this measure (one by one specific flag for specific column)

Ritaf1983_1-1693419329259.png

Link to a sample file : Here 

 

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

Sorry I just read the 2nd half of your reply, I need to create one for each condition. No problem. Let me try that then accept as solution. Thanks.

Oh, and I thought that you wanted to mark with green all cells if even one of the columns in the row is green.
You can ignore my last suggestion with a combined flag.
Note that I attached a link to the sample file in the first reply, you can download the PBIX and follow my steps.

Thank you. Before I try that, can I combine for all 7 conditions in 1 DAX measure?
How would I do that?
Because each condition is its own calculated column, so the DAX flag measure has to include all 7 fields, and for any of them if the field is "True", then the same result would be a GREEN Format.


Thank you!

Hi @ayeoh 
If I understand you correctly, then yes you can create 1 measure using OR on your condition:

7 columns test = IF(SELECTEDVALUE('Table'[column1])=TRUE() || SELECTEDVALUE('Table'[column2])=TRUE() || SELECTEDVALUE('Table'[column3])=TRUE(),1,0)....
But even with this, you need to modify conditional formatting separately for each column (using the same combined flag). 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.