In this blog, you will learn how to highlight maximum and minimum values in a Power BI Line chart.
Let’s get started-
Download the sample Dataset from below link-
Follow these steps-
Step-1: Add a Line chart visualization to the Report canvas and drag some columns.
Step-2: Now create two measures for minimum and maximum sales, and write the following DAX code below.
MAX Sales = VAR GetAllMarket = ALLSELECTED(Orders[Market]) VAR GetMaxValue= MAXX(GetAllMarket, CALCULATE(SUM(Orders[Sales]))) RETURN IF(SUM(Orders[Sales]) = GetMaxValue, GetMaxValue, Blank())
MIN Sales = VAR GetAllMarket = ALLSELECTED(Orders[Market]) VAR GetMinValue= MINX(GetAllMarket, CALCULATE(SUM(Orders[Sales]))) RETURN IF(SUM(Orders[Sales]) = GetMinValue, GetMinValue, Blank())
Step-3: Now add both measures into visual.
Enable Data labels only for MIN & MAX values-
Follow these steps-
Step-1: Go to Format section > Enable Data labels.
Step-2: It will enables data labels for all, but we want see data labels only for max & min. so follow below steps-
Under Data labels > Enable customize series > and for Sales turned off Show.
Change Data color for MIN & MAX values-
Go to Format section > Data color > Change color individually.
Add Max & Min line into Line chart visual-
Refer for more details: Add max & min lines into line chart visuals
Select Line chart > Go to Analytics Pane > Add Min & MAX line for Sales.
Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.
Hi Am not able to add a minimum and maximum data point .why?
Hello Adarsh, Follow the post carefully, may be you are missing something.