Forum Discussion
Comparing raw count against category for two different dates in Matrix visual
Hi Sir,
How to compare raw count against category for two different dates in Matrix visual using conditional formatting. I have a matrix table where I am showing the volume like below for two dates and I want to highlight if the volume is increasing or decreasing using conditional formatting.
| Category | 15-Aug-23 | 16-Aug-23 |
| A | 45 | 35 |
| B | 55 | 65 |
| C | 57 | 68 |
You can create a measure like this , all i am doing is subtracking the current date from the previous date and if is less than 0 i give it a 1 else 0.. You can then use this measure to create your conditional format.
Prior Day Volume =
VAR currentDate = SELECTEDVALUE('date header'[Date], BLANK())VAR priorDate = CALCULATE(MAX('date header'[Date]), ALL('date header'[Date]), 'date header'[Date] < currentDate)RETURNIF(CALCULATE(SELECTEDVALUE('date header'[Value]), 'date header'[Date] = priorDate)-CALCULATE(SELECTEDVALUE('date header'[Value]), 'date header'[Date] = currentDate)<0,1,0)
1 Reply
- BmejiaSuper User
You can create a measure like this , all i am doing is subtracking the current date from the previous date and if is less than 0 i give it a 1 else 0.. You can then use this measure to create your conditional format.
Prior Day Volume =
VAR currentDate = SELECTEDVALUE('date header'[Date], BLANK())VAR priorDate = CALCULATE(MAX('date header'[Date]), ALL('date header'[Date]), 'date header'[Date] < currentDate)RETURNIF(CALCULATE(SELECTEDVALUE('date header'[Value]), 'date header'[Date] = priorDate)-CALCULATE(SELECTEDVALUE('date header'[Value]), 'date header'[Date] = currentDate)<0,1,0)