Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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 @Thanvi5696
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 @Thanvi5696
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 @Thanvi5696
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 @Thanvi5696
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
83 | |
64 | |
61 | |
55 |
User | Count |
---|---|
179 | |
108 | |
105 | |
71 | |
70 |