Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Thanvi5696
Frequent Visitor

min and max data point highlights

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 

MaxValue =
VAR SelectedDate = SELECTEDVALUE('table'[Date])
RETURN
    CALCULATE(
        MAX('Table'[Total_Apparent_Power]),
        FILTER(
            ALL('table'),
            'table'[Date] = SelectedDate
        )
    )
MaxLabel = IF(MAX('table'[Total_Apparent_Power]) = [MaxValue], MAX('table'[Total_Apparent_Power]), BLANK())

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.

1 ACCEPTED 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.

 

dec.png

 

tap.png

 

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
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

 

minmax.png

 

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

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


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.

 

dec.png

 

tap.png

 

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


v-zhengdxu-msft
Community Support
Community Support

Hi @Thanvi5696 

 

Maybe you can try this alternative workaround:

First of all, I create a set of sample:

vzhengdxumsft_0-1714960949418.png

Then add a Line and clustered column chart in report view:

vzhengdxumsft_1-1714961036882.png

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:

vzhengdxumsft_3-1714961620019.pngvzhengdxumsft_2-1714961602092.png

 

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.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.