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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
@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)
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:
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 119 | |
| 100 | |
| 72 | |
| 69 | |
| 65 |