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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
gumis_rulez
Helper I
Helper I

Background formatting in the table based on segment

I am using folllowing measure to choose transport_ids for current day and arrival time.

Tooltip = 
CONCATENATEX (
    CALCULATETABLE (
        VALUES ( 'Direct 03 10'[Route name] )
        
    ),
    [Route name],
    //","
    UNICHAR(10)
)

 

The measure works perfectly but would like to add another feature. Each transport_id belongs to one of the three segments. I would like to have in the table below each transport_id background formatted acc to the segment it belongs to. It would be easy if for example for Monday 18:00 there would be transport_id's which would belong to one segment. But it happens that for one particular date and time there might be three transports and each would be a part of different segment, so each should have different background colour. How to achieve this? I beleve concatex will not work in this case.

 

task01.jpg

 

 

 

 

https://drive.google.com/file/d/1dk-fMeZusbzDt5hKbNKoPE8suUdAf_8n/view?usp=sharing 

1 REPLY 1
lbendlin
Super User
Super User

1. no need for CALCULATETABLE

 

 

Tooltip = 
CONCATENATEX (
    VALUES ( 'Direct 03 10'[Route name] ),
    [Route name],
    UNICHAR(10)
)

 

 

2. You would need to use SVG to render different colors inside a matrix cell, and do all kinds of rectangle gymnastics

css - Background color of text in SVG - Stack Overflow

 

lbendlin_0-1729517512343.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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