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
Shameem
Regular Visitor

Compare previous data and highlight the change

Hello,

 

We have a requirement where I need to highlight the change in category.

 

I have Product, Plan , Time Period and Category fields . All fields are coming from different tables of data model.

 

Expected  to highlight ID:  3, 7 (as they have change in category)

 

IDProductPlanTime PeriodCategory
1Prod1Plan12024-012
2Prod1Plan12024-022
3Prod1Plan12024-031
4Prod1Plan22024-012
5Prod1Plan22024-022
6Prod2Plan12024-011
7Prod2Plan12024-024

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@Shameem I am glad to help you.
Hello,@lbendlin ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.


Did you get your problem solved? If you don't have a suitable solution for your problem, you can refer to my suggestion.
By creating a measure and setting a conditional format based on the value of the measure.

vjtianmsft_0-1721637825376.png

 

 

M_Pro_plan_Changed02 = 
VAR CurrentCategory = MAX('Table'[Category])
VAR PreviousCategory = 
    CALCULATE(
        MAX('Table'[Category]),
        FILTER(
            ALL('Table'),
            'Table'[Product] = MAX('Table'[Product]) &&
            'Table'[Plan] = MAX('Table'[Plan]) &&
            'Table'[Time Period] < MAX('Table'[Time Period])
        )
    )
RETURN
IF(
    ISBLANK(PreviousCategory) || CurrentCategory = PreviousCategory,
    0,
    1
)

 

 

vjtianmsft_1-1721637884901.png

 

vjtianmsft_2-1721637895955.pngvjtianmsft_3-1721637903243.pngvjtianmsft_4-1721637911461.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

3 REPLIES 3
Anonymous
Not applicable

Hi,@Shameem I am glad to help you.
Hello,@lbendlin ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.


Did you get your problem solved? If you don't have a suitable solution for your problem, you can refer to my suggestion.
By creating a measure and setting a conditional format based on the value of the measure.

vjtianmsft_0-1721637825376.png

 

 

M_Pro_plan_Changed02 = 
VAR CurrentCategory = MAX('Table'[Category])
VAR PreviousCategory = 
    CALCULATE(
        MAX('Table'[Category]),
        FILTER(
            ALL('Table'),
            'Table'[Product] = MAX('Table'[Product]) &&
            'Table'[Plan] = MAX('Table'[Plan]) &&
            'Table'[Time Period] < MAX('Table'[Time Period])
        )
    )
RETURN
IF(
    ISBLANK(PreviousCategory) || CurrentCategory = PreviousCategory,
    0,
    1
)

 

 

vjtianmsft_1-1721637884901.png

 

vjtianmsft_2-1721637895955.pngvjtianmsft_3-1721637903243.pngvjtianmsft_4-1721637911461.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

 

lbendlin
Super User
Super User

Do you want this done in Power Query, as a calculated column, a measure, or as a visual calculation?  What is your sort column? ID?

Hello,  It can be as a calculated column, a measure, or as a visual calculation anything that is feasiable , 

The idea is to have the background colur of a column 'Access' highlighted in vizualization when the catogeroy is changed.

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.