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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Table Background - Conditional Formatting

Hi, 

 

I'm attempting to add a light mode/dark mode option in my report and I've succeeded to do the workaround in all the visuals so far but the table. 

The screenshots below are showing what the end outcome I'm looking for when I toggle the Dark Mode/Light Mode button with the DAX formula below (I use it for all the other visuals in the Conditional Formatting function and I have a table in the background with the HEX colours for each option): 

Colour Background =
VAR _selected = SELECTEDVALUE(Colours[Background])
RETURN
IF (ISBLANK(_selected), "Dark", _selected)
 
I know I can do conditional formatting in a table for each field, but it takes away the alternate row effect and if there is no other choice, I'll probably go that way. But for larger tables, it's a total headache.
 
The question is: Is there a DAX Code or workaround to add conditional formatting to an entire table for:

Text Color
Background Color
Alternate Text Color
Alternate Background Color
 
The information shown below is from Power BI finance sample by the way: 

Caesarul_0-1673533542024.png

Caesarul_1-1673533572836.png

 

Thank you very much for all your support!

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

use two different table visuals, each with their theme, and then use bookmarks to switch their visibility.

View solution in original post

4 REPLIES 4
BipinLala26
Frequent Visitor

@Anonymous  - I also spent few hours on implementing the light/ dark mode option in my report for all the visuals and background, but in the end got stuck for table/ matrix.

Its really sad that there is no option/ shortcut to add such formatting on text and cell background in a better & faster way than using conditional formatting. I have huge tables on some pages and can't really add conditional formatting to each page. Will have to drop the entire idea of theme changing option.

 

I hope there is a solution for this soon!

If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com/?forum=2d80fd4a-16cb-4189-896b-e0dac5e08b41

lbendlin
Super User
Super User

use two different table visuals, each with their theme, and then use bookmarks to switch their visibility.

Anonymous
Not applicable

hi @lbendlin that's definetly a solution!

 

Although I do have another bookmark for filters, so I'll exponentially double my number of bookmarks to work around that table.

 

Please let me know if there are other ways. (I sort of already gave up and chosen the column conditional formatting. One thing that I hate is that the column header colour doesn't have conditional formatting.)

 

Thanks for the tip!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.