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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lawada
Helper III
Helper III

highlight min and max values in line chart

hello,

 

i want to highlight the max and mn values in the line chart 

the line chart has the measure :

 

placed orders = CALCULATE(distinctCOUNT(orders[order_id]),USERELATIONSHIP(Calender[Date],orders[placing_date]),USERELATIONSHIP(countries[counntry_id],orders[country_id]))
lawada_0-1644144166581.png

note : i cant find conditional formating for the data colors 

lawada_1-1644144217259.png

 

1 ACCEPTED SOLUTION

Hi, @lawada 

 

You can try to create two measures and add them to line chart.

Like this:

 

 

 

maxcount = IF ( [placed orders] = MAXX ( ALL ( orders ), [placed orders] ), [placed orders] )
mincount = IF ( [placed orders] = MINX ( ALL ( orders ), [placed orders] ), [placed orders] ) 

 

 

vjaneygmsft_0-1644398827461.png

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
 
Best Regards,
Community Support Team _ Janey

 

View solution in original post

5 REPLIES 5
ValtteriN
Super User
Super User

Hi,

Here is how to do this:

1. Create a format measure:
e.g.

Format Sales =
var _table = SUMMARIZE(all(Sales),Sales[Date],"Sum",SUM(Sales[Value]))
var maxsales = MAXX(_table,[Sum])
var minsales = MINX(_table,[Sum])
var currentS = SUM(Sales[Value])
return
switch(true(),
currentS = maxsales,"Green",
currentS =minsales, "Red",
"Blue")

2. Create a bar chart and select conditional format here:
ValtteriN_0-1644150483654.png

 

3. Create this rule and change the chart to a line chart:
ValtteriN_1-1644150532831.png

4. End result

ValtteriN_2-1644150560504.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




how can i apply this foramting measure to my current measure as im using function (userelationship)  to filter by columns from other tables?

Hi,

You can place your current measure as the second condition of MAXX and MINXX. The idea is to compare the values on a table level and get the values we want to higlight into variables. You also need to modify the _table variable accordingly.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




can you explain how to adjust the _table variable part accoording to the measure i provided? as im using mote than one single table so i cant use summarize function . also i still dont have conditional formatting for the data colors as i mentioned in the pictures i attached

Hi, @lawada 

 

You can try to create two measures and add them to line chart.

Like this:

 

 

 

maxcount = IF ( [placed orders] = MAXX ( ALL ( orders ), [placed orders] ), [placed orders] )
mincount = IF ( [placed orders] = MINX ( ALL ( orders ), [placed orders] ), [placed orders] ) 

 

 

vjaneygmsft_0-1644398827461.png

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
 
Best Regards,
Community Support Team _ Janey

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors