Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
How to Change the Bar graph's color to orange only when the 5 consecutive increments of the value? in power bi
I only changed the color from mar-toJulyy to orange the rest remain blue
Month
Value
Jan | 200 |
Feb | 250 |
Mar | 180 |
Apr | 280 |
May | 290 |
Jun | 300 |
July | 350 |
Aug | 150 |
Sep | 179 |
Oct | 800 |
Nov | 200 |
Dec | 400 |
it only works for some particular year if the year changes does not work
Hi @Kotebe
Thanks for the reply from Sahir_Maharaj .
The following measures are for your reference, I added an index column to your original data.
Consecutive Increments =
VAR _CurrentIndex = MAX('Table'[Index])
VAR _CurrentValue = MAX('Table'[Value])
VAR _Prev1 = CALCULATE(MAX('Table'[Value]), FILTER(ALL('Table'), 'Table'[Index] = _CurrentIndex - 1))
VAR _Prev2 = CALCULATE(MAX('Table'[Value]), FILTER(ALL('Table'), 'Table'[Index] = _CurrentIndex - 2))
VAR _Prev3 = CALCULATE(MAX('Table'[Value]), FILTER(ALL('Table'), 'Table'[Index] = _CurrentIndex - 3))
VAR _Prev4 = CALCULATE(MAX('Table'[Value]), FILTER(ALL('Table'), 'Table'[Index] = _CurrentIndex - 4))
VAR _CheckIncrements =
IF(_CurrentValue > _Prev1 && _Prev1 > _Prev2 && _Prev2 > _Prev3 && _Prev3 > _Prev4, 1, 0)
RETURN
_CheckIncrements
Color =
VAR _Index =
MAXX(FILTER(ALL('Table'), [Consecutive Increments] = 1), 'Table'[Index])
RETURN
IF(
MAX('Table'[Index]) IN {_Index, _Index - 1, _Index - 2, _Index - 3, _Index - 4},
"orange",
"blue"
)
Then set the conditional format in format your visual -> Columns -> Color.
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
What about If I added Product Family as a filter and ignore one out lier ?
What would be if there is one outlier can be considerd as Trend
How to Change the Bar graph's color to orange only when the 5 consecutive increments of the value? in power bi . I only changed the color from March to orange the rest remain blue
Month Value if the value which is an outlier it should be considered
Jan | 200 |
Feb | 250 |
Mar | 180 |
Apr | 280 |
May | 290 |
Jun | 300 |
July | 350 |
Aug | 150 |
Sep | 179 |
Oct | 800 |
Nov | 200 |
Dec | 400 |
If you add a month it will not work , indexing working for only 12 month if it is 24 month Indexing will not work, Can you show me how it work indexing for Jan-2023 and Jan-2024-, jan-2025.... ?
This a summarized table, How can Like Order date in Table 1 and Date in Date table Product in Tabl1
The one above is only a summarized table from the Date table and Table1 if I add Product to the summarized table I the aggregation is not working
Hi @Kotebe
Do you mean that the Month and Value columns come from two tables? If so, could you please provide some sample data from both tables so that we can help you better? How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best Regards,
Yulia Xu
Thank you
Hello @Kotebe,
Can you please try creating a calculated column to identify if a bar meets the condition:
Consecutive Increments =
VAR CurrentMonth = 'Table'[Month]
VAR CurrentValue = 'Table'[Value]
VAR PreviousValues =
TOPN(
5,
FILTER(
'Table',
'Table'[Month] < CurrentMonth
),
'Table'[Month], DESC
)
VAR IsIncrement =
IF(
COUNTROWS(PreviousValues) = 5 &&
MAXX(PreviousValues, 'Table'[Value]) < CurrentValue,
TRUE(),
FALSE()
)
RETURN
IF(IsIncrement, "Orange", "Blue")
Then you can apply conditional formatting.
Hope this helps.
What about I added Product family as a filter content and based on that and ignore one outlier and shous as a green for consecuative increment
Lets take the lasst 6 month consecuative month increment with one outlier , which means if the Value increase consequatively even if we have one outlier we can say a trend , other wise if not consecuative increment , we can say not a trend
What DAX code handle these scenario
These gives me all bar chart blue, even though it has orange section
Have you test these code?
How do Mangae the Outlier of the 5 month Consecuetive increment of highlighted with Orange color ?