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
Jvera2286
Frequent Visitor

I need to highlight the max value of a bar chart that is filtered with tabular editor

Hi, I´m trying to create a measure to highlight the max value of a bar chart using the conditional formatting. Said chart is filtered with a calculation group from tabular editor to show the las 13 months based on a selected month. 
This is the calculation group used as filter:

 

VAR NumOfMonths = -13
VAR ReferenceDate = MAX (Calendario1[fecha] )
VAR PreviousDates = DATESINPERIOD ( 'Calendario ult 12 meses'[fecha]; ReferenceDate; NumOfMonths; MONTH )
VAR Result = CALCULATE ( selectedmeasure(); REMOVEFILTERS ( Calendario1 ); KEEPFILTERS ( PreviousDates ); USERELATIONSHIP ( 'Calendario ult 12 meses'[fecha]; Calendario1[fecha] ) )
RETURN Result

 

and this is the measure I'm trying to use to highlight the max value:


Medida Resaltar Maximo =
VAR Maximo = CALCULATE(
MAXX(ALLSELECTED('Calendario ult 12 meses'[fecha]), SELECTEDMEASURE())
)
RETURN
IF(SELECTEDMEASURE() = Maximo, 1, 0)

however all the columns change color afterwards.



2 REPLIES 2
amitchandak
Super User
Super User

@Jvera2286 , if you are not using calculation group, then use a measure like

 

Medida Resaltar Maximo =
VAR Maximo = CALCULATE(
MAXX(Values('Calendario ult 12 meses'[fecha]), [Measure]), allselecteted()
)
RETURN
IF([Measure]= Maximo, 1, 0)

 

In calculation group try like

 

Medida Resaltar Maximo =
VAR Maximo = CALCULATE(
MAXX(Values('Calendario ult 12 meses'[fecha]), SELECTEDMEASURE()), allselecteted()
)
RETURN
IF(SELECTEDMEASURE() = Maximo, 1, 0)

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

Hi, thanks for your answer, I tried your solution but all columns change color after applying it. I turned it into a table and this was the result:

Jvera2286_0-1720102347768.png

The Period I'm filtering is from Mar-2023 till Mar-2024 but it seems that it evaulates the maxx part of the measure each month vs itself instead of comparing each month value with the max value of the series.


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