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
Anonymous
Not applicable

HighLight the value if greater then previous value

hi,

I want to highlight the value is greater than the previous value.

 

Like below

ValueDateCost
Mango1/1/202112
Mango2/1/202123
Mango3/1/202113
Mango4/1/202145
Mango5/1/202123

 

is this possible?

 

thanks,

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

You can try below formula:

M_ =
VAR previous =
    CALCULATE ( MAX ( 'Table'[Cost] ), 'Table'[Date] < MAX ( 'Table'[Date] ) )
RETURN
    (
        IF (
            previous = BLANK (),
            "black",
            IF ( MAX ( 'Table'[Cost] ) > previous, "red", "black" )
        )
    )

vhenrykmstf_1-1657100295350.png

 

vhenrykmstf_0-1657100281528.png

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

You can try below formula:

M_ =
VAR previous =
    CALCULATE ( MAX ( 'Table'[Cost] ), 'Table'[Date] < MAX ( 'Table'[Date] ) )
RETURN
    (
        IF (
            previous = BLANK (),
            "black",
            IF ( MAX ( 'Table'[Cost] ) > previous, "red", "black" )
        )
    )

vhenrykmstf_1-1657100295350.png

 

vhenrykmstf_0-1657100281528.png

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

@Anonymous , Create a new measure and use that in conditional formatting using field value option

 

new measure =
var _max = maxx(filter(allselected(Table), Table[Value] = max(Table[Value]) && Table[Date] < max(Table[Date])), Table[Date])
return
if(maxx(filter(allselected(Table), Table[Value] = max(Table[Value]) && Table[Date] =_max ), Table[Cost]) = max(Table[Cost]) , "Red", "Black")

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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