Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |