Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
| Site Name | 7/9/2023 | 7/10/2023 | 7/11/2023 |
| Ahangama | 1100 | 1058 | 1070 |
| Akmeemana | 1063 | 1016 | 1094 |
I have above table with some more data. If current dates count is higher than the previous dates count I want to highlight current date count red. If current dates count is less than the previuos dates count I want to highlight current date count red. How to achieve this using power bi?
Solved! Go to Solution.
Hi @mosam ,
"Current dates count is higher than the previous dates count" means the largest count.
1.Here suppose your count is a column.
Raw sample data:
So you can create a measure like:
Measure = var _max=MAXX(FILTER(ALLSELECTED('Table'),[Site Name]=MAX('Table'[Site Name])),[Count])
return IF(_max=SUM('Table'[Count]),"Red")
Conditional Formatting in the matrix:
Result:
2.If you count is a measure.
Raw sample data:
Create a measure for conditional formatting:
Measure 3 = var _max=MAXX(FILTER(ALLSELECTED('Table (2)'),[Site Name]=MAX('Table (2)'[Site Name])),[Measure 2])
return IF(_max=[Measure 2],"red")
After conditional formatting is set, the result is below.
Hope that helps.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mosam ,
"Current dates count is higher than the previous dates count" means the largest count.
1.Here suppose your count is a column.
Raw sample data:
So you can create a measure like:
Measure = var _max=MAXX(FILTER(ALLSELECTED('Table'),[Site Name]=MAX('Table'[Site Name])),[Count])
return IF(_max=SUM('Table'[Count]),"Red")
Conditional Formatting in the matrix:
Result:
2.If you count is a measure.
Raw sample data:
Create a measure for conditional formatting:
Measure 3 = var _max=MAXX(FILTER(ALLSELECTED('Table (2)'),[Site Name]=MAX('Table (2)'[Site Name])),[Measure 2])
return IF(_max=[Measure 2],"red")
After conditional formatting is set, the result is below.
Hope that helps.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
It depends of rest of date values, but for given dataset this might work.
Then you apply Conditional Formatting to [Count] and in "Format style" you select newly created measure [Formatting].
Formatting =
VAR _Current_Date = MAX( 'Table'[Date] )
VAR _Current_Count = [Count]
VAR _Before = DATEADD( 'Table'[Date], -1, MONTH )
VAR _Before_Count =
CALCULATE(
[Count],
_Before
)
VAR _Result =
IF(
AND( _Current_Count > 0, _Before_Count > 0 ),
IF(
_Current_Count > _Before_Count,
"#BC544B"
)
)
RETURN
_Result
This is the complete table.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 24 | |
| 22 | |
| 21 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 59 | |
| 53 | |
| 41 | |
| 31 | |
| 31 |