Min & Max values on chart
Home » Power BI » Highlighting the min & max values in a Power BI column chart

Highlighting the min & max values in a Power BI column chart

In this blog you will understand “How to highlight Maximum & Minimum values in a Power BI column chart?”.

Let’s get started-

Download Sample dataset- Global_superstore_2016.xls

Following these steps-

Step-1: Import Orders dataset from Global superstore file.

Step-2: Now add one clustered column chart in report canvas with some columns.

Column chart in Power BI

Column chart in Power BI




Step-3: You can see in above chart “Africa” has minimum sales & “Asia Pacific” has Maximum sales.

Step-4: Now follow these colors to highlight min & max values on column chart –

  • For minimum sales, color = Red
  • For maximum sales, color = Green
  • Others, color= Grey

Step-5: Create a measure with below DAX code-

Max_Min Color =
VAR GetAllMarket = ALLSELECTED(Orders[Market])
VAR GetMaxValue= MAXX(GetAllMarket, CALCULATE(SUM(Orders[Sales])))
VAR GetMinValue= MINX(GetAllMarket, CALCULATE(SUM(Orders[Sales])))
RETURN
IF(SUM(Orders[Sales]) = GetMaxValue,"#00b300",
IF(SUM(Orders[Sales])= GetMinValue, "#ff0000","#D3D3D3")
)

Step-6: Select chart & go to format bar> Data color > Click on fx icon.

function icon for conditional formatting

function icon for conditional formatting




Step-7: Conditional formatting – Data colors window appears, set below options-

Format by: Select Field value

Based on field: Select measure

Select measure for data colors

Select measure for data colors

Step-8: See the final result.

Highlight max & min values on chart

Highlight max & min values on chart




Refer more Power BI Post – Power BI

Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome.

Leave a Reply