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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
BS_03_22
Frequent Visitor

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 @BS_03_22 ,

 

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 @BS_03_22 ,

 

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

@BS_03_22 , 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")

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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