Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

highlighting max & min value in column chart for date/date

hi,

 

kindly ref to the sample file here.

 

while i'm able to do the conditional formatting to highlight the min/max values for each year in column charts for quarter & month (as shown in the sample file), i'm unable to reflect the same on day/dated-basis.

i managed to get the desired result for the month column chart using following dax formula 

Del-DpAr-Dur-MxMn-M-CF

VAR MaxValue = 
MAXX( ALLSELECTED ( 'Calendar'[Month], 'Calendar'[MonthNo] ),
[Del-DpAr-Dur]
)

VAR
MinValue =
MINX( ALLSELECTED ( 'Calendar'[Month], 'Calendar'[MonthNo] ),
[Del-DpAr-Dur]
)

VAR
Color =
IF( [Del-DpAr-Dur] = MaxValue, "#F9D987",
IF( [Del-DpAr-Dur] = MinValue, "#AADBD6",
"#D3D9B4") )
RETURN
Color

 

i'd appreciate any help to hilite the min/max values for the day/dated column chart for each year.

 

many tks & krgds, 

-nik 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

for info, (while i'm still checking) it seems that the following solution that i got help from someone works

VAR _Max_Value =
CALCULATE(
MAXX(
ALLSELECTED( 'Calendar' ) ,
[Del-DpAr-Dur] ) ,
ALLEXCEPT( 'Calendar' , 'Calendar'[Year] ) ,
VALUES( 'Calendar'[Year] ) )


VAR _Min_Value =
CALCULATE(
MINX(
ALLSELECTED ( 'Calendar' ) ,
[Del-DpAr-Dur] ),
ALLEXCEPT( 'Calendar' , 'Calendar'[Year] ) ,
VALUES( 'Calendar'[Year] ) )


VAR _Color =
IF( [Del-DpAr-Dur] = _Max_Value , "#F9D987" ,
IF( [Del-DpAr-Dur] = _Min_Value , "#AADBD6" ,
"#D3D9B4") )

RETURN
_Color

 

krgds, -nik

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try like, you can combine them using isinscope

 

For Date =
VAR MaxValue = MAXX( ALLSELECTED ( 'Calendar'), 'Calendar'[Date] )
VAR MinValue = MINX( ALLSELECTED ( 'Calendar'), 'Calendar'[Date] )

VAR Color =
IF( 'Calendar'[Date] = MaxValue, "#F9D987",
IF( 'Calendar'[Date] = MinValue, "#AADBD6",
"#D3D9B4") )
RETURN Color

For Month
=
VAR MaxValue = eomonth(MAXX( ALLSELECTED ( 'Calendar'), 'Calendar'[Date] ),0)
VAR MinValue = eomonth(MINX( ALLSELECTED ( 'Calendar'), 'Calendar'[Date] ),0)

VAR Color =
IF( eomonth('Calendar'[Date],0)= MaxValue, "#F9D987",
IF( eomonth('Calendar'[Date],0) = MinValue, "#AADBD6",
"#D3D9B4") )
RETURN Color

For Year
=
VAR MaxValue = MAXX( ALLSELECTED ( 'Calendar'), 'Calendar'[Year] )
VAR MinValue = MINX( ALLSELECTED ( 'Calendar'), 'Calendar'[Year] )

VAR Color =
IF( 'Calendar'[Year] = MaxValue, "#F9D987",
IF( 'Calendar'[Year] = MinValue, "#AADBD6",
"#D3D9B4") )
RETURN Color

 

For Qtr =
VAR MaxValue = MAXX( ALLSELECTED ( 'Calendar'), 'Calendar'[Date] )
VAR MinValue = MINX( ALLSELECTED ( 'Calendar'), 'Calendar'[Date] )

VAR MaxQtr = MAXX( Filter( ALLSELECTED ( 'Calendar'), 'Calendar'[Date] = MaxValue), 'Calendar'[Qtr Year] )
VAR MinQrr = MINX( Filter( ALLSELECTED ( 'Calendar'), 'Calendar'[Date] = MinValue), 'Calendar'[Qtr Year] )

VAR Color =
IF( 'Calendar'[Qtr Year] = MaxQtr, "#F9D987",
IF( 'Calendar'[Qtr Year] = MinValue, "#AADBD6",
"#D3D9B4") )
RETURN Color

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thanks again, @amitchandak.

 

i'm sorry if it's a bother. since i'm still not very familiar with the isinscope function especially in using it for conditional formatting, can you kindly run this by again?


to kindly recap, the goal is to be able to hilite the min/max values for the day/dated for each year in the column chart.
tks, -nik

Anonymous
Not applicable

for info, (while i'm still checking) it seems that the following solution that i got help from someone works

VAR _Max_Value =
CALCULATE(
MAXX(
ALLSELECTED( 'Calendar' ) ,
[Del-DpAr-Dur] ) ,
ALLEXCEPT( 'Calendar' , 'Calendar'[Year] ) ,
VALUES( 'Calendar'[Year] ) )


VAR _Min_Value =
CALCULATE(
MINX(
ALLSELECTED ( 'Calendar' ) ,
[Del-DpAr-Dur] ),
ALLEXCEPT( 'Calendar' , 'Calendar'[Year] ) ,
VALUES( 'Calendar'[Year] ) )


VAR _Color =
IF( [Del-DpAr-Dur] = _Max_Value , "#F9D987" ,
IF( [Del-DpAr-Dur] = _Min_Value , "#AADBD6" ,
"#D3D9B4") )

RETURN
_Color

 

krgds, -nik

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors