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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
LABrowne
Helper II
Helper II

Filter table visual based on background colour

Hello there,

 

I have an Order Table in power bi that has 3 different colours based on below conditions: 

 

Background Colours:

VAR CancelledOrders = CONTAINSSTRING( MAX (), "Cancelled")
VAR UnderReviewOrders = CONTAINSSTRING( MAX (Order[OrderNumber]), "Under Review") && TODAY() <= [Expiry Date Less 90 Days]
VAR BestOrders = [OrderSat (%)] > 1 && Order[No. of Products] >= 2 && TODAY() <= [Expiry Date Less 90 Days]
RETURN SWITCH(
    TRUE(),
    CancelledOrders, "Blue",
    UnderReviewOrders, "Red",
    BestOrders, "Green"
)
 
The colours on the table are returning correctly is there anyway to filter this?
 
Any help much appreciated.
 
 

 

 

1 ACCEPTED SOLUTION

3 REPLIES 3
tamerj1
Super User
Super User

Hi @LABrowne 
You can manually inset a table 'Colors' that contains one column [Color] having only three values "Blue", "Red" & "Green"

Create a slicer out of this column then place the following measure in the filter pane of your table/matrix, select "Is not blank" then apply the filter.

 

Color Filter =
COUNTROWS (
    FILTER (
        VALUES ( Order[OrderNumber] ),
        [Background Colour] IN VALUES ( Colors[Color] )
    )
)

Hello,

 

Thanks for your response.

 

Does inserting a column work well with sql server - direct query method?

@LABrowne 

Yes of course 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.