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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
LouiseR
Regular Visitor

Add Icons based on Variance from Previous Day

Hello there, I need some help.  I am trying to create a matrix (multi-level visual) that has icons (R/A/G) to indicate whether the number went up or down from previous day.

 

My data table looks like this;

LouiseR_0-1701765562313.png

 

 

The result needed;

LouiseR_1-1701766527189.png

 

Been looking around for answers but have not found anything that helps my case.

Appreciate your help!

1 ACCEPTED SOLUTION
ValtteriN
Community Champion
Community Champion

Hi,

Here is how to do this:

Data:

ValtteriN_0-1701774570545.png

Dax:

 
Test for previous =
var _p = MAX('Table (15)'[Date])
var _cv = MAX('Table (15)'[Value])
var _pv = CALCULATE(MAX('Table (15)'[Value]),ALL('Table (15)'[Date]),'Table (15)'[Date]<_p)
RETURN
SWITCH(TRUE(),
_cv=_pv,0, //same
_cv<_pv,1, //up
_cv>_pv,2) //down

Add rule:
ValtteriN_1-1701774939533.png

 

End result:
ValtteriN_2-1701775073209.png

 

If you don't want arrows on the first row change the dax:

Test for previous =
var _p = MAX('Table (15)'[Date])
var _cv = MAX('Table (15)'[Value])
var _pv = CALCULATE(MAX('Table (15)'[Value]),ALL('Table (15)'[Date]),'Table (15)'[Date]<_p)
RETURN
SWITCH(TRUE(),
_cv=_pv,0, //same
_cv<_pv,1, //up
_pv=BLANK(),BLANK(),
_cv>_pv,2) //down

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @LouiseR ,

I have created a simple sample, please refer to it to see if it helps you.

Create 2 measures. To get the count value before today.

Measure =
CALCULATE (
    MAX ( 'Table'[COUNT] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Region] = SELECTEDVALUE ( 'Table'[Region] )
            && 'Table'[AGEING] = SELECTEDVALUE ( 'Table'[AGEING] )
            && 'Table'[Date] < SELECTEDVALUE ( 'Table'[Date] )
    )
)

Then compare the 2 results.

result =
IF (
    MAX ( 'Table'[COUNT] ) = [Measure],
    0,
    IF (
        MAX ( 'Table'[COUNT] ) < [Measure],
        1,
        IF ( MAX ( 'Table'[COUNT] ) > [Measure], 2 )
    )
)

 Then create the conditional formatting.

vrongtiepmsft_0-1703744754930.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

 

ValtteriN
Community Champion
Community Champion

Hi,

Here is how to do this:

Data:

ValtteriN_0-1701774570545.png

Dax:

 
Test for previous =
var _p = MAX('Table (15)'[Date])
var _cv = MAX('Table (15)'[Value])
var _pv = CALCULATE(MAX('Table (15)'[Value]),ALL('Table (15)'[Date]),'Table (15)'[Date]<_p)
RETURN
SWITCH(TRUE(),
_cv=_pv,0, //same
_cv<_pv,1, //up
_cv>_pv,2) //down

Add rule:
ValtteriN_1-1701774939533.png

 

End result:
ValtteriN_2-1701775073209.png

 

If you don't want arrows on the first row change the dax:

Test for previous =
var _p = MAX('Table (15)'[Date])
var _cv = MAX('Table (15)'[Value])
var _pv = CALCULATE(MAX('Table (15)'[Value]),ALL('Table (15)'[Date]),'Table (15)'[Date]<_p)
RETURN
SWITCH(TRUE(),
_cv=_pv,0, //same
_cv<_pv,1, //up
_pv=BLANK(),BLANK(),
_cv>_pv,2) //down

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Your solution is great, however in my Matrix visual - it is the sum of the count.

The results look weird and even if the numbers go up or down it doesn't change the icons/results.

Below is the image of the Data table as well.

 Appreciate your help on this.

 

1_BIResult.jpg2_BITable.jpg

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.