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
sonya7
Helper III
Helper III

Making High/Low balls green-red on the line chart.

 How can I make a graphical representation of any KPI to be selected on the line chart where total orders values ​​are displayed monthly, in a way that makes the highest value within the months green, the lowest value red and the remaining gray?

 

my pbix : https://drive.google.com/file/d/1Vn8KcHdnDxxv70hCMcUU5BCHtNwzqYxV/view?usp=drive_link

 

 

1 ACCEPTED SOLUTION

Bar color = 
var a = CALCULATETABLE(SUMMARIZECOLUMNS(DimDate[YearMonth],DimDate[YearMonthNumber]),allselected())
var b = FILTER(ADDCOLUMNS(a,"sm", [Total Revenue]),[sm]>0)
var t = [Total Revenue]
return switch(TRUE(),
t = MINX(b,[sm]),"red",
t = maxx(b,[sm]),"lightgreen",
"lightgrey")

View solution in original post

8 REPLIES 8
lbendlin
Super User
Super User

I could swear this was possible before but somehow the marker colors are no longer dynamic.  No idea what is happening here.

 

lbendlin_0-1699130387307.png

It works with columns 

 

lbendlin_1-1699131091981.png

Bar color = 
var a = CALCULATETABLE(SUMMARIZECOLUMNS(DimDate[Date]),REMOVEFILTERS(DimDate[Date]))
var b = ADDCOLUMNS(a,"sm", CALCULATE([Total Revenue]))
var t = [Total Revenue]
return switch(TRUE(),
t = MINX(b,[sm]),"red",
t = maxx(b,[sm]),"lightgreen",
"lightgrey")

hi , I want to show my chart month-year. (Sep 18, Sep 19 etc. ) When all years are selected, the column in the month with the maximum value will be red. 

I want to show my chart month-year. When all years are selected, the column in the month with the maximum value will be red.

I also have to do this in markers on the line chart. Making a column first and then turning it into a line sometimes works (conditional formatting)

That seems to differ from the previous requirements. Please clarify.

Your chart is daily. I want to show monthly (as sep 18) and mark the highest value among these months. By the way, I use the order_purchase_timestamp field as the date field.

ex: When the year filter 2018 is selected, let's mark the value in the highest month; when no year is selected, let's mark the highest month in all years.

Those are all different scenarios. You would need to use ISINSCOPE to figure out which scenario you are in and even then you can have mixed situations where the users expand one year but not the others etc.

I don't think it's a complicated situation. I only want this.

sonya7_0-1699193280230.png

 

sonya7_1-1699193382576.png

sonya7_0-1699193512687.png

 

Bar color = 
var a = CALCULATETABLE(SUMMARIZECOLUMNS(DimDate[YearMonth],DimDate[YearMonthNumber]),allselected())
var b = FILTER(ADDCOLUMNS(a,"sm", [Total Revenue]),[sm]>0)
var t = [Total Revenue]
return switch(TRUE(),
t = MINX(b,[sm]),"red",
t = maxx(b,[sm]),"lightgreen",
"lightgrey")

Right now, just finding the max value is enough for me. max value = 1.194.883 ( november 2017)

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.