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
Niki
Helper III
Helper III

Conditional formatting nog working, please help!

I have a report with a table with load of columns and information.

Some of the columns are yes/no columns (only they say J / N because I'm in the Netherlands)

For some of the columns I want to hightlight the J of the N. In this example I want to make the N have an orange background.

 

I created this measure to use in condition formatting:

 

Formatting LBD = IF ( SELECTEDVALUE ( 'Table1'[LBD] ) = "N", "#E37222" )

Then I format the background of the column in the table like you can see in the screenshot.

Niki_0-1658146786932.png

 

But then it is sometimes working, and sometimes not, I am going nuts!!

I created test measures, to see what comes out of the : selected value ( 'Table1'[LBD] ) 

I also changed he measure to max ( 'Table1'[LBD] ) , when putting this in the test measure and in a KPI box, it shows up as "N", another testmeasure then gives me as a result: "#E37222"

But in the table it will not light up in orange.

I also checked if the data (Selected person) has multiple values, it does have extra rows, but all of them give "N" for the LBD column. Also other persons, do light up orange, with also multiple lines in the table.

Only way to make it work, is to put the measure (Formatting LBD = IF ( SELECTEDVALUE ( 'Table1'[LBD] ) = "N", "#E37222" ))

also in the table, for some reason it then works properly.

 

But my table has about 5 columns I would like to check and I don't want to add 5 columns, just for formattingpurposes, it will not give the end user any extra information...

 

Also, deleting other columns in the table, has an effect apparently, because it looks like the formatting is randomly changing. Who knows what is going on? I really don't understand why it would matter what other columns do when every row for the same person gives "N" and thats what the measure is checking on...

 

I cannot share data, as it is all very sensitive ( I work in healthcare and every column is about a patient or doctor )

 

Hope someone can help me, I encounter it a lot.

 

KR

 

 

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Niki ,

 

While using selectedvalue() function, please make sure it will return single value. If it returned multiple values, the result would be blank.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi, 

 

Thanks,

I started out with using Max (instead of selected value), but this isn't working either.

 

It randomly lights up cells, but not all...

This is not a really hard question right, I cannot imagine I am the only one who wants to light up cells with textvalues in a table in PowerBI...

 

What is the solution to doing this? Adding the measure to the table, solves the problem, but its already an huge table with a lot of info, I don't want to add 5 more columns just for conditional formatting, shouldn't have to right?

 

KR

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.