Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Sales vs Previous Sales

Hey everyone, 

 

I want to compare the sales of a quarter compared with its previous quarter. 

So, when the Total Sales is higher compared to the Total Sales Previous Quarter, I want to show a green arrow.

A red arrow should be shown when the Total Sales is lower. And a question Mark when you can't compare it, 

so when there is no data for the Total Sales or the Total Sales Previous Quarter. 

 

My measure is as follows:

 

Sales vs Previous Sales =
IF(
HASONEVALUE('Total Sales'[Total Sales]),
IF(OR(ISBLANK([TotalSales]), [Total Sales Previous Quarter]),
[Question Mark ], IF(
[TotalSales] > [Total Sales Previous Quarter],
[Arrow Up ↑],
[Arrow Down ↓]
)
)
)

 

The results is shown below. But This is not what I expected. I am looking for the result as shown in the most right column. 

I made several adjustments in my measure, but not with the result I was looking for. 
Can anyone help me out, please?

 

  • Measure = 
    SWITCH( 
      TRUE,
      ISBLANK( SUM('Table'[Column2] )) || ISBLANK( SUM('Table'[Column4]) ),[Question Mark],
      SUM('Table'[Column2]) > SUM('Table'[Column4]),[Arrow Up ↑],
      SUM('Table'[Column2]) < SUM('Table'[Column4]),[Arrow Down ↓]
    )

2 Replies