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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Comparison with previous value in matrix and show up down icon

Hi,

 

I have created a matrix and in that matrix am trying to compare the value in W2 column with the value in W1 column (means current column with the previous column) and based on that am trying to show up, down arrow icon. I am able to create the matrix but not able to do the comparison part and icon showing part. Can anyone please help me. I have attached sample pbix file and screenshot Test.JPG

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous 

 

Try this measure.

Compare W2 With W1 = 
VAR WAVE =
    SELECTEDVALUE ( Sheet1[Wave] )
VAR Country =
    SELECTEDVALUE ( Sheet1[Country] )
VAR s =
    CALCULATE ( SUM ( Sheet1[Sales] ) )
VAR FiltereTable1 =
    FILTER ( ALL ( Sheet1 ), Sheet1[Wave] = "W1" && Sheet1[Country] = Country )
VAR W1 =
    SUMX ( FiltereTable1, Sheet1[Sales] )
VAR RESULT =
    SWITCH ( TRUE ()
    , WAVE = "W2" && s > W1, 1
    , WAVE = "W2" && s <= W1, 2
    , 0 )
RETURN
    RESULT

 

Apply background color conditional formatting as below to get the idea how it works.

 

W2W1.PNG

 

 

This works in case you just want to Compare W2 with W1. However there are other scenarios like, if you want to compare (W3 with W1) or (W4 with W1) and so on; then you will have to add more conditions in SWITCH.

If that's the case you should also consider that how this can be tackled when your Waves Column will have more values like(W5, W6 ... Wn). 

 

Thanks

 

 

Anonymous
Not applicable

Thanks for the reply but this can be applied when you know the number of waves you have. Right now we have 8 waves and in future there will be many more then how we will tackle this? And the solution you have provided is am already using as an alternative.

Anonymous
Not applicable

Hi @Anonymous Can you share the pbix file again I can't see that.

 

Thanks

Anonymous
Not applicable

You can download the file from below link:

 

http://dl.dropboxusercontent.com/s/btmcxqq9bzg5kr4/Test.pbix?dl=0

harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

See if this helps

 

 

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting

https://www.youtube.com/watch?v=BbuikATa3ow

https://www.youtube.com/watch?v=MAISRa88bl0

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Anonymous
Not applicable

I know how to apply conditional formatting but the thing is here I want to compare the values in a column based on other column

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.