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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
ann33
Helper I
Helper I

Gradient coloring in rows in matrix

Hi All,

 

I have the below heat map scenario where I want to color gradiently per row in the matrix.

ann33_0-1688475841683.png

Per row the lowest value should have dark color and highest value should have light color.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ann33 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1689058998811.png

(2) We can create a calculated column.

rank =
IF (
    'Table'[value] <> BLANK (),
    RANKX (
        FILTER (
            'Table',
            'Table'[date1] = EARLIER ( 'Table'[date1] )
                && 'Table'[value] <> BLANK ()
        ),
        'Table'[value],
        ,
        ASC,
        SKIP
    ),
    0
)

(3) Setting the Conditional Format and then the result is as follows.

vtangjiemsft_1-1689059178667.pngvtangjiemsft_2-1689059195957.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @ann33 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1689058998811.png

(2) We can create a calculated column.

rank =
IF (
    'Table'[value] <> BLANK (),
    RANKX (
        FILTER (
            'Table',
            'Table'[date1] = EARLIER ( 'Table'[date1] )
                && 'Table'[value] <> BLANK ()
        ),
        'Table'[value],
        ,
        ASC,
        SKIP
    ),
    0
)

(3) Setting the Conditional Format and then the result is as follows.

vtangjiemsft_1-1689059178667.pngvtangjiemsft_2-1689059195957.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

amitchandak
Super User
Super User

@ann33 , Create measure with date column use in the column

Assume column date as Matrix column field

and Row Date as Matrix row field

 

Use this measure and do gradient formatting based on this measure

 

calculate(

datediff( minx(allselected(Table), Table[Col Date]) , Max(Table[Col Date]) , day) , removefilters(Table[Row date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.