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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I was trying to highlight only min and max data labels in the line chart.
I have used date column which is of this format
01-01-2024 |
,start time
10.00.00 AM |
, End time
11.00.00 AM |
in the x axis and in y axis total apparent power and I have slicer for date, based on the slicer the line chart data is filtered.
i have created a DAX measure to highlight min and max data points but its not highlighting
so there is lots of data point is highlighted, for one date there will be lots of total apparent since data is captured every one hour. Can any one help to provide Perfect DAX measure to highlight max total apparent power dynamically based on the filter applied by the slicer.
Solved! Go to Solution.
Hi @Anonymous
If I have 4.3, 4.4 and 4.5 (the max) in my data set, 4.5 is highlighted as the max value, please check my example PBIX file. So for your numbers it should also work.
If the same isn't happening for you then either your data is somehow diferent or more likely the DAX measure isn't working as expected. Either way I'd need to see the data you are using to figure out why.
Can you post your data here, or better still, link to your PBIX file?
Regards
Phil
Proud to be a Super User!
Hi @Anonymous
Download PBIX file with example below
How do you wish to highlight the min and max points? You could chnage the color of the label (value) with this measure and using it as the conditional formatting rule for the label color
Max_TAP_CF =
VAR _max = CALCULATE(MAX('DataTable'[Total_Apparent_Power]), FILTER(ALL('DataTable'), SELECTEDVALUE('DataTable'[Date]) = 'DataTable'[Date]))
VAR _min = CALCULATE(MIN('DataTable'[Total_Apparent_Power]), FILTER(ALL('DataTable'), SELECTEDVALUE('DataTable'[Date]) = 'DataTable'[Date]))
VAR _point = SELECTEDVALUE('DataTable'[Total_Apparent_Power])
RETURN
IF(_point = _max, "orange", IF( _point = _min, "green", "white"))
which gives this
As I've chosen to color all other labels/values white they do not appear. You can show these of course if you wish be leaving them the default black color.
Regards
Phil
Proud to be a Super User!
Hi PhilipTreacy,
I have tried using this measure but it's not highlight single max value instead if the line chart has data points of 4.5,4.4,4.3 then all the data points are highlighted instead of one
Hi @Anonymous
If I have 4.3, 4.4 and 4.5 (the max) in my data set, 4.5 is highlighted as the max value, please check my example PBIX file. So for your numbers it should also work.
If the same isn't happening for you then either your data is somehow diferent or more likely the DAX measure isn't working as expected. Either way I'd need to see the data you are using to figure out why.
Can you post your data here, or better still, link to your PBIX file?
Regards
Phil
Proud to be a Super User!
Hi @Anonymous
Maybe you can try this alternative workaround:
First of all, I create a set of sample:
Then add a Line and clustered column chart in report view:
Next, add a measure:
MEASURE =
VAR _maxValue =
CALCULATE ( MAX ( 'Table'[Total_Apparent_Power] ), ALLSELECTED ( 'Table' ) )
VAR _minValue =
CALCULATE ( MIN ( 'Table'[Total_Apparent_Power] ), ALLSELECTED ( 'Table' ) )
RETURN
IF (
MAX ( 'Table'[Total_Apparent_Power] ) = _maxValue,
_maxValue,
IF ( MAX ( 'Table'[Total_Apparent_Power] ) = _minValue, _minValue )
)
And put it in the Column y-axis field, the result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
98 | |
75 | |
74 | |
49 | |
26 |