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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
lawada
Helper III
Helper III

conditional formating for measure inside a matrix

i have created a cohort with a matrix visual  where :

rows= month 

columns= difference between current month and previous month

values= measure [total users]

 

i want the color to change according to the measure value each month 

lawada_0-1638089976137.png

 

note that  the first value in the matrix is blank and i want the formating to start from value 0 

i have created this measure and used in the conditional formating 

 total users formating =
IF(
MAX(table[months_diff])<>BLANK(),
CALCULATE(
RANKX(
ALLSELECTED( table[months_diff]),
[total users]
),
KEEPFILTERS(table[months_diff] <> BLANK())
)
)
 
but its not including the value 0 in the formating
1 ACCEPTED SOLUTION

I accidentally copied and pasted the MAX into the filter part.

 

See if this works:

total users formating =
IF (
    NOT ( ISBLANK ( MAX ( table[months_diff] ) ) ),
    CALCULATE (
        RANKX ( ALLSELECTED ( table[months_diff] ), [total users] ),
        KEEPFILTERS ( NOT ( ISBLANK ( table[months_diff] ) ) )
    )
)

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

I think the problem is that 0 <> BLANK() evaluates as False.

 

See if this works any better:

total users formating =
IF (
    NOT ( ISBLANK ( MAX ( table[months_diff] ) ) ),
    CALCULATE (
        RANKX ( ALLSELECTED ( table[months_diff] ), [total users] ),
        KEEPFILTERS ( NOT ( ISBLANK ( MAX ( table[months_diff] ) ) ) )
    )
)

im getting this error when using the measure

The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

I accidentally copied and pasted the MAX into the filter part.

 

See if this works:

total users formating =
IF (
    NOT ( ISBLANK ( MAX ( table[months_diff] ) ) ),
    CALCULATE (
        RANKX ( ALLSELECTED ( table[months_diff] ), [total users] ),
        KEEPFILTERS ( NOT ( ISBLANK ( table[months_diff] ) ) )
    )
)

now its working thank you

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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