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
timknox
Helper II
Helper II

Conditional Formatting

Hi,

 

Wondering if someone can help.

 

I have a Matrix as below (example using Excel for simpli:

 

Screenshot 2019-11-07 at 16.44.05.png

 

My question:

 

Is it possible to conditionally format the columns, to show the columns that relate to dates before todays date?  So with the table above, it would look like this for today 7th November:

 

Screenshot 2019-11-07 at 16.45.23.png

 

Thanks for your help

1 ACCEPTED SOLUTION

Hey @timknox ,

 

this is not that simple as you changed the interaction of the Matrix visual to none, to show all the AP's as column headers.

 

For this  I created an unrelated table that contains the AP and the Serial columns from the Sheet2 table using this DAX:

AP Unrelated = SELECTCOLUMNS('Sheet1 (2)' , "AP" , 'Sheet1 (2)'[AP] , "Serial" , 'Sheet1 (2)'[Serial])

 The data model will look like this:

image.png

I created a slicer in the report that shows the APs from the new table.

I also created a measure that adjusts the background color, this measure looks like this:

backgroundColor = 
var selectedAPSerial = IF(HASONEVALUE('AP Unrelated'[AP]) , MAX('AP Unrelated'[Serial]) , BLANK())
var allAPs = SELECTCOLUMNS(FILTER(ALL('AP Unrelated'), 'AP Unrelated'[Serial] <= selectedAPSerial) , "AP" , [AP])

return
//CONCATENATEX(allAPs , [AP] , " | ")
IF(FIRSTNONBLANK('Sheet1 (2)'[AP] , 0) in allAPs , "orange" , BLANK())

I assigned the measure above to the conditional formatting option of the Matrix visual background color

image.png

 And configured the dialog like so:

image.png

This then makes my report look like this:

image.png

Hopefully this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey,

 

yes that's possible, please create a pbix that contains sample data and reflects your Power BI data model, upload the pbix file to onedrive or dropbox and share the link.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

hi Tom,

 

Here is a sample file i have put together......

 

https://www.dropbox.com/s/mimwl05yfoncoqv/sample.pbix?dl=0 

 

So basically, when you select a specific AP in the slicer (for example AP 06) the column AP 06 and the one to the left should be coloured.....

 

Does that make sense?

 

Kind regards

 

Tim

Hey @timknox ,

 

this is not that simple as you changed the interaction of the Matrix visual to none, to show all the AP's as column headers.

 

For this  I created an unrelated table that contains the AP and the Serial columns from the Sheet2 table using this DAX:

AP Unrelated = SELECTCOLUMNS('Sheet1 (2)' , "AP" , 'Sheet1 (2)'[AP] , "Serial" , 'Sheet1 (2)'[Serial])

 The data model will look like this:

image.png

I created a slicer in the report that shows the APs from the new table.

I also created a measure that adjusts the background color, this measure looks like this:

backgroundColor = 
var selectedAPSerial = IF(HASONEVALUE('AP Unrelated'[AP]) , MAX('AP Unrelated'[Serial]) , BLANK())
var allAPs = SELECTCOLUMNS(FILTER(ALL('AP Unrelated'), 'AP Unrelated'[Serial] <= selectedAPSerial) , "AP" , [AP])

return
//CONCATENATEX(allAPs , [AP] , " | ")
IF(FIRSTNONBLANK('Sheet1 (2)'[AP] , 0) in allAPs , "orange" , BLANK())

I assigned the measure above to the conditional formatting option of the Matrix visual background color

image.png

 And configured the dialog like so:

image.png

This then makes my report look like this:

image.png

Hopefully this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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 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.

Top Solution Authors