Forum Discussion

Mahmed1's avatar
Mahmed1
Icon for Helper IV rankHelper IV
3 years ago
Solved

Matrix Column last Date comparison

Hi

 

i have a matrix that has departments in rows and months in columns

 

i wanted to add some conditional formatting at the end column and check to see if the last column (excluding the column total) is higher than the previous month. 

 

I tried


CondFormatBarsLast2Months = 

VAR LastMonth = Max(Calender_Lookup[Date])

VAR Last2Month = Datesadd(LastMonth, -1, Month)

Return

IF(LastMonth > Last2Month, "Green")

 

but having no luck

 

i will run into 2 problems if

1) User Selects January as previous month will be December previos year

2) if there is only 1 month in the visual

2)

2 Replies