cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ermak
Frequent Visitor

Conditional formatting in tables

Hello!

Can I configure conditional formatting so that the criterion is the previous value of the parameter? For example, in the report on positions in the search engine, I need to show whether the position has improved, deteriorated or remained unchanged.

On the screen I showed how it should look about.image.png

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User IV
Super User IV

Re: Conditional formatting in tables

Hi @ermak 

 

You can create a measure like below and use it for conditional formating in your matrix

_arrows = 
VAR _previous = CALCULATE( SUM( 'Table'[Value] ), PREVIOUSDAY( 'Table'[Date] ) )
VAR _current = SUM( 'Table'[Value] )
RETURN SWITCH( 
    TRUE(),
    _previous = BLANK(), BLANK(),
    _previous < _current, 1,
    _previous = _current, 2,
    _previous > _current, 3
)

I've attached a file with the solution as well.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

 

View solution in original post

Super User IV
Super User IV

Re: Conditional formatting in tables

Hi @ermak

 

I've updated the formula on the attached.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

4 REPLIES 4
Super User IV
Super User IV

Re: Conditional formatting in tables

Hi @ermak 

 

You can create a measure like below and use it for conditional formating in your matrix

_arrows = 
VAR _previous = CALCULATE( SUM( 'Table'[Value] ), PREVIOUSDAY( 'Table'[Date] ) )
VAR _current = SUM( 'Table'[Value] )
RETURN SWITCH( 
    TRUE(),
    _previous = BLANK(), BLANK(),
    _previous < _current, 1,
    _previous = _current, 2,
    _previous > _current, 3
)

I've attached a file with the solution as well.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

 

View solution in original post

AC_DATA
Frequent Visitor

Re: Conditional formatting in tables

The first thing that comes to my mind is to write a calculated column to indicate the previous status and then use that column to drive the conditional formatting using a logical less-than, greater-than, or equal-to.

ermak
Frequent Visitor

Re: Conditional formatting in tables

Hello, @Mariusz !

Thank you very much, but it only works if the dates are in order, for example 01.02.2020, 02.02.2020, 03.02.2020, etc. But it doesn't work if the dates are spaced, for example, 01.02.2020, 13.02.2020, 28.02.2020.

 

Is there any way to fix this?

Super User IV
Super User IV

Re: Conditional formatting in tables

Hi @ermak

 

I've updated the formula on the attached.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors