This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi All
I have below expression from Mr Amit , it can help me color the latest year red color :-

Remark :- for the above sales by YrMthSort bar chart , when i filter year=2020 , the Dec bar will color red.
But for my case i cannot filter .
Solved! Go to Solution.
The reason why the last column is not colored Red is because the evaluation of max YrMthSort is giving back the very last field, which in your case was end of 2021.
I changed the Date table range to having max date of Today.
Date = CALENDAR(Date(2000,01,01),Today())
Then when your calculation evaluates the max YrMthSort it colors the last bar in the visual
The reason why the last column is not colored Red is because the evaluation of max YrMthSort is giving back the very last field, which in your case was end of 2021.
I changed the Date table range to having max date of Today.
Date = CALENDAR(Date(2000,01,01),Today())
Then when your calculation evaluates the max YrMthSort it colors the last bar in the visual
@Rigensis Many thank for your help , now it work fine now.
Below is my orginal date expression :-
Date = CALENDAR(Date(2000,01,01),date(2021,12,31))
Below is your propose date expression to make latest month bar turn red.
My question is after changing to your date expression :-
Date = CALENDAR(Date(2000,01,01),Today())
will it affect on my other report ? I did a quick check it seen to work fine. Look like your expression on date is the best.
Paul Yeo
@admin11 ,
You have to create a color measure and use that in data color advance option with "Field value"
COlor year =
var _maxx(allselected(Date),Date[Year])
return
if(Max(Date[Year]) = _max , "red", "blue")
refer for step
Color Field - Color Measure - Conditional formatting
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
https://youtu.be/M5PvQUy-L_4?t=531
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 23 | |
| 22 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 64 | |
| 41 | |
| 27 | |
| 22 | |
| 20 |